From e50c1cbaf1805f352435d82044d966af256c8d37 Mon Sep 17 00:00:00 2001 From: Adhiraj Singh Date: Tue, 30 Jun 2020 20:57:49 +0530 Subject: [PATCH] Initial Conversion to typescript --- .eslintrc.js | 18 + .gitignore | 2 + .prettierrc.js | 7 + Binary/Constants.ts | 205 + Binary/Decoder.ts | 227 + Binary/Encoder.ts | 146 + Binary/Tests.ts | 81 + Binary/WAMessage.d.ts | 6893 ++++++ Binary/WAMessage.js | 19977 ++++++++++++++++++ {binary_coding => Binary}/def.proto | 0 {example => Example}/ConversationExtract.js | 0 Example/example.ts | 144 + {example => Media}/ma_gif.mp4 | Bin {example => Media}/meme.jpeg | Bin Media/received_img.jpeg | Bin 0 -> 57782 bytes WAClient/Base.ts | 229 + WAClient/Constants.ts | 109 + WAClient/Messages.ts | 172 + WAClient/Tests.ts | 152 + WAClient/Utils.ts | 132 + WAClient/WAClient.ts | 6 + WAConnection/Base.ts | 264 + WAConnection/Connect.ts | 248 + WAConnection/Constants.ts | 73 + WAConnection/Tests.ts | 58 + WAConnection/Utils.ts | 70 + WAConnection/Validation.ts | 164 + WAConnection/WAConnection.ts | 2 + WhatsAppWeb.Query.js | 204 - WhatsAppWeb.Recv.js | 257 - WhatsAppWeb.Send.js | 329 - WhatsAppWeb.Session.js | 311 - WhatsAppWeb.Utils.js | 123 - WhatsAppWeb.js | 275 - binary_coding/.DS_Store | Bin 6148 -> 0 bytes binary_coding/binary_coding_tests.js | 25 - binary_coding/binary_encoder.js | 476 - binary_coding/whatsapp_message_coding.json | 1889 -- example/.DS_Store | Bin 6148 -> 0 bytes example/example.js | 106 - package-lock.json | 2462 ++- package.json | 30 +- 42 files changed, 31850 insertions(+), 4016 deletions(-) create mode 100644 .eslintrc.js create mode 100644 .prettierrc.js create mode 100644 Binary/Constants.ts create mode 100644 Binary/Decoder.ts create mode 100644 Binary/Encoder.ts create mode 100644 Binary/Tests.ts create mode 100644 Binary/WAMessage.d.ts create mode 100644 Binary/WAMessage.js rename {binary_coding => Binary}/def.proto (100%) rename {example => Example}/ConversationExtract.js (100%) create mode 100644 Example/example.ts rename {example => Media}/ma_gif.mp4 (100%) rename {example => Media}/meme.jpeg (100%) create mode 100644 Media/received_img.jpeg create mode 100644 WAClient/Base.ts create mode 100644 WAClient/Constants.ts create mode 100644 WAClient/Messages.ts create mode 100644 WAClient/Tests.ts create mode 100644 WAClient/Utils.ts create mode 100644 WAClient/WAClient.ts create mode 100644 WAConnection/Base.ts create mode 100644 WAConnection/Connect.ts create mode 100644 WAConnection/Constants.ts create mode 100644 WAConnection/Tests.ts create mode 100644 WAConnection/Utils.ts create mode 100644 WAConnection/Validation.ts create mode 100644 WAConnection/WAConnection.ts delete mode 100644 WhatsAppWeb.Query.js delete mode 100644 WhatsAppWeb.Recv.js delete mode 100644 WhatsAppWeb.Send.js delete mode 100644 WhatsAppWeb.Session.js delete mode 100644 WhatsAppWeb.Utils.js delete mode 100644 WhatsAppWeb.js delete mode 100644 binary_coding/.DS_Store delete mode 100644 binary_coding/binary_coding_tests.js delete mode 100644 binary_coding/binary_encoder.js delete mode 100644 binary_coding/whatsapp_message_coding.json delete mode 100644 example/.DS_Store delete mode 100644 example/example.js diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..10a24e6 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,18 @@ +module.exports = { + parser: "@typescript-eslint/parser", // Specifies the ESLint parser + parserOptions: { + ecmaVersion: 2020, // Allows for the parsing of modern ECMAScript features + sourceType: "module" // Allows for the use of imports + }, + extends: [ + "plugin:@typescript-eslint/recommended", // Uses the recommended rules from the @typescript-eslint/eslint-plugin + "prettier/@typescript-eslint", // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier + "plugin:prettier/recommended" // Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array. + ], + rules: { + // Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs + // e.g. "@typescript-eslint/explicit-function-return-type": "off", + "@typescript-eslint/no-namespace": "off", + "@typescript-eslint/ban-types": "off" + } +} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 6b91e23..611c2c4 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,5 @@ test_pvt.js media_decode_tests.js output.csv package-lock.json +*/.DS_Store +.DS_Store diff --git a/.prettierrc.js b/.prettierrc.js new file mode 100644 index 0000000..d1ca80a --- /dev/null +++ b/.prettierrc.js @@ -0,0 +1,7 @@ +module.exports = { + semi: false, + trailingComma: "all", + singleQuote: true, + printWidth: 120, + tabWidth: 4 +} \ No newline at end of file diff --git a/Binary/Constants.ts b/Binary/Constants.ts new file mode 100644 index 0000000..9c5b9a8 --- /dev/null +++ b/Binary/Constants.ts @@ -0,0 +1,205 @@ +import { proto as Coding } from './WAMessage' + +export namespace WA { + export const Tags = { + LIST_EMPTY: 0, + STREAM_END: 2, + DICTIONARY_0: 236, + DICTIONARY_1: 237, + DICTIONARY_2: 238, + DICTIONARY_3: 239, + LIST_8: 248, + LIST_16: 249, + JID_PAIR: 250, + HEX_8: 251, + BINARY_8: 252, + BINARY_20: 253, + BINARY_32: 254, + NIBBLE_8: 255, + SINGLE_BYTE_MAX: 256, + PACKED_MAX: 254, + } + export const DoubleByteTokens = [] + export const SingleByteTokens = [ + null, + null, + null, + '200', + '400', + '404', + '500', + '501', + '502', + 'action', + 'add', + 'after', + 'archive', + 'author', + 'available', + 'battery', + 'before', + 'body', + 'broadcast', + 'chat', + 'clear', + 'code', + 'composing', + 'contacts', + 'count', + 'create', + 'debug', + 'delete', + 'demote', + 'duplicate', + 'encoding', + 'error', + 'false', + 'filehash', + 'from', + 'g.us', + 'group', + 'groups_v2', + 'height', + 'id', + 'image', + 'in', + 'index', + 'invis', + 'item', + 'jid', + 'kind', + 'last', + 'leave', + 'live', + 'log', + 'media', + 'message', + 'mimetype', + 'missing', + 'modify', + 'name', + 'notification', + 'notify', + 'out', + 'owner', + 'participant', + 'paused', + 'picture', + 'played', + 'presence', + 'preview', + 'promote', + 'query', + 'raw', + 'read', + 'receipt', + 'received', + 'recipient', + 'recording', + 'relay', + 'remove', + 'response', + 'resume', + 'retry', + 's.whatsapp.net', + 'seconds', + 'set', + 'size', + 'status', + 'subject', + 'subscribe', + 't', + 'text', + 'to', + 'true', + 'type', + 'unarchive', + 'unavailable', + 'url', + 'user', + 'value', + 'web', + 'width', + 'mute', + 'read_only', + 'admin', + 'creator', + 'short', + 'update', + 'powersave', + 'checksum', + 'epoch', + 'block', + 'previous', + '409', + 'replaced', + 'reason', + 'spam', + 'modify_tag', + 'message_info', + 'delivery', + 'emoji', + 'title', + 'description', + 'canonical-url', + 'matched-text', + 'star', + 'unstar', + 'media_key', + 'filename', + 'identity', + 'unread', + 'page', + 'page_count', + 'search', + 'media_message', + 'security', + 'call_log', + 'profile', + 'ciphertext', + 'invite', + 'gif', + 'vcard', + 'frequent', + 'privacy', + 'blacklist', + 'whitelist', + 'verify', + 'location', + 'document', + 'elapsed', + 'revoke_invite', + 'expiration', + 'unsubscribe', + 'disable', + 'vname', + 'old_jid', + 'new_jid', + 'announcement', + 'locked', + 'prop', + 'label', + 'color', + 'call', + 'offer', + 'call-id', + 'quick_reply', + 'sticker', + 'pay_t', + 'accept', + 'reject', + 'sticker_pack', + 'invalid', + 'canceled', + 'missed', + 'connected', + 'result', + 'audio', + 'video', + 'recent', + ] + export const Message = Coding.WebMessageInfo + export type NodeAttributes = Record | string | null + export type NodeData = Array | any | null + export type Node = [string, NodeAttributes, NodeData] +} diff --git a/Binary/Decoder.ts b/Binary/Decoder.ts new file mode 100644 index 0000000..d2aa484 --- /dev/null +++ b/Binary/Decoder.ts @@ -0,0 +1,227 @@ +import { WA } from './Constants' + +export default class Decoder { + buffer: Buffer = null + index = 0 + + checkEOS(length: number) { + if (this.index + length > this.buffer.length) { + throw 'end of stream' + } + } + next() { + const value = this.buffer[this.index] + this.index += 1 + return value + } + readByte() { + this.checkEOS(1) + return this.next() + } + readStringFromChars(length: number) { + this.checkEOS(length) + const value = this.buffer.slice(this.index, this.index + length) + + this.index += length + return new TextDecoder().decode(value) + } + readBytes(n: number): Buffer { + this.checkEOS(n) + const value = this.buffer.slice(this.index, this.index + n) + this.index += n + return value + } + readInt(n: number, littleEndian = false) { + this.checkEOS(n) + let val = 0 + for (let i = 0; i < n; i++) { + const shift = littleEndian ? i : n - 1 - i + val |= this.next() << (shift * 8) + } + return val + } + readInt20() { + this.checkEOS(3) + return ((this.next() & 15) << 16) + (this.next() << 8) + this.next() + } + unpackHex(value: number) { + if (value >= 0 && value < 16) { + return value < 10 ? '0'.charCodeAt(0) + value : 'A'.charCodeAt(0) + value - 10 + } + throw 'invalid hex: ' + value + } + unpackNibble(value: number) { + if (value >= 0 && value <= 9) { + return '0'.charCodeAt(0) + value + } + switch (value) { + case 10: + return '-'.charCodeAt(0) + case 11: + return '.'.charCodeAt(0) + case 15: + return '\0'.charCodeAt(0) + default: + throw 'invalid nibble: ' + value + } + } + unpackByte(tag: number, value: number) { + if (tag === WA.Tags.NIBBLE_8) { + return this.unpackNibble(value) + } else if (tag === WA.Tags.HEX_8) { + return this.unpackHex(value) + } else { + throw 'unknown tag: ' + tag + } + } + readPacked8(tag: number) { + const startByte = this.readByte() + let value = '' + + for (let i = 0; i < (startByte & 127); i++) { + const curByte = this.readByte() + value += String.fromCharCode(this.unpackByte(tag, (curByte & 0xf0) >> 4)) + value += String.fromCharCode(this.unpackByte(tag, curByte & 0x0f)) + } + if (startByte >> 7 !== 0) { + value = value.slice(0, -1) + } + return value + } + readRangedVarInt(min, max, description = 'unknown') { + // value = + throw 'WTF; should not be called' + } + isListTag(tag: number) { + return tag === WA.Tags.LIST_EMPTY || tag === WA.Tags.LIST_8 || tag === WA.Tags.LIST_16 + } + readListSize(tag: number) { + switch (tag) { + case WA.Tags.LIST_EMPTY: + return 0 + case WA.Tags.LIST_8: + return this.readByte() + case WA.Tags.LIST_16: + return this.readInt(2) + default: + throw 'invalid tag for list size: ' + tag + } + } + + readString(tag: number): string { + if (tag >= 3 && tag <= 235) { + const token = this.getToken(tag) + return token === 's.whatsapp.net' ? 'c.us' : token + } + + switch (tag) { + case WA.Tags.DICTIONARY_0: + case WA.Tags.DICTIONARY_1: + case WA.Tags.DICTIONARY_2: + case WA.Tags.DICTIONARY_3: + return this.getTokenDouble(tag - WA.Tags.DICTIONARY_0, this.readByte()) + case WA.Tags.LIST_EMPTY: + return null + case WA.Tags.BINARY_8: + return this.readStringFromChars(this.readByte()) + case WA.Tags.BINARY_20: + return this.readStringFromChars(this.readInt20()) + case WA.Tags.BINARY_32: + return this.readStringFromChars(this.readInt(4)) + case WA.Tags.JID_PAIR: + const i = this.readString(this.readByte()) + const j = this.readString(this.readByte()) + if (i && j) { + return i + '@' + j + } + throw 'invalid jid pair: ' + i + ', ' + j + case WA.Tags.HEX_8: + case WA.Tags.NIBBLE_8: + return this.readPacked8(tag) + default: + throw 'invalid string with tag: ' + tag + } + } + readAttributes(n: number) { + if (n !== 0) { + const attributes: WA.NodeAttributes = {} + for (let i = 0; i < n; i++) { + const key = this.readString(this.readByte()) + const b = this.readByte() + + attributes[key] = this.readString(b) + } + return attributes + } + return null + } + readList(tag: number) { + const arr = [...new Array(this.readListSize(tag))] + return arr.map(() => this.readNode()) + } + getToken(index: number) { + if (index < 3 || index >= WA.SingleByteTokens.length) { + throw 'invalid token index: ' + index + } + return WA.SingleByteTokens[index] + } + getTokenDouble(index1, index2): string { + const n = 256 * index1 + index2 + if (n < 0 || n > WA.DoubleByteTokens.length) { + throw 'invalid double token index: ' + n + } + return WA.DoubleByteTokens[n] + } + readNode(): WA.Node { + const listSize = this.readListSize(this.readByte()) + const descrTag = this.readByte() + if (descrTag === WA.Tags.STREAM_END) { + throw 'unexpected stream end' + } + + const descr = this.readString(descrTag) + if (listSize === 0 || !descr) { + throw 'invalid node' + } + + const attrs = this.readAttributes((listSize - 1) >> 1) + let content: WA.NodeData = null + + if (listSize % 2 === 0) { + const tag = this.readByte() + if (this.isListTag(tag)) { + content = this.readList(tag) + } else { + let decoded: Buffer | string + switch (tag) { + case WA.Tags.BINARY_8: + decoded = this.readBytes(this.readByte()) + break + case WA.Tags.BINARY_20: + decoded = this.readBytes(this.readInt20()) + break + case WA.Tags.BINARY_32: + decoded = this.readBytes(this.readInt(4)) + break + default: + decoded = this.readString(tag) + break + } + + if (descr === 'message' && Buffer.isBuffer(decoded)) { + content = WA.Message.decode(decoded) + } else { + content = decoded + } + } + } + + return [descr, attrs, content] + } + + read(buffer: Buffer) { + this.buffer = buffer + this.index = 0 + return this.readNode() + } +} diff --git a/Binary/Encoder.ts b/Binary/Encoder.ts new file mode 100644 index 0000000..b365fca --- /dev/null +++ b/Binary/Encoder.ts @@ -0,0 +1,146 @@ +import { WA } from './Constants' +import { proto } from './WAMessage' + +export default class Encoder { + data: Array = [] + + pushByte(value: number) { + this.data.push(value & 0xff) + } + pushInt(value: number, n: number, littleEndian = false) { + for (let i = 0; i < n; i++) { + const curShift = littleEndian ? i : n - 1 - i + this.data.push((value >> (curShift * 8)) & 0xff) + } + } + pushInt20(value: number) { + this.pushBytes([(value >> 16) & 0x0f, (value >> 8) & 0xff, value & 0xff]) + } + pushBytes(bytes: Uint8Array | Array) { + this.data.push(...bytes) + } + pushString(str: string) { + const bytes = new TextEncoder().encode(str) + this.pushBytes(bytes) + } + writeByteLength(length: number) { + if (length >= 4294967296) { + throw 'string too large to encode: ' + length + } + if (length >= 1 << 20) { + this.pushByte(WA.Tags.BINARY_32) + this.pushInt(length, 4) // 32 bit integer + } else if (length >= 256) { + this.pushByte(WA.Tags.BINARY_20) + this.pushInt20(length) + } else { + this.pushByte(WA.Tags.BINARY_8) + this.pushByte(length) + } + } + writeStringRaw(string: string) { + this.writeByteLength(string.length) + this.pushString(string) + } + writeJid(left: string, right: string) { + this.pushByte(WA.Tags.JID_PAIR) + left && left.length > 0 ? this.writeString(left) : this.writeToken(WA.Tags.LIST_EMPTY) + this.writeString(right) + } + writeToken(token: number) { + if (token < 245) { + this.pushByte(token) + } else if (token <= 500) { + throw 'invalid token' + } + } + writeString(token: string, i: boolean = null) { + if (token === 'c.us') { + token = 's.whatsapp.net' + } + + const tokenIndex = WA.SingleByteTokens.indexOf(token) + if (!i && token === 's.whatsapp.net') { + this.writeToken(tokenIndex) + } else if (tokenIndex >= 0) { + if (tokenIndex < WA.Tags.SINGLE_BYTE_MAX) { + this.writeToken(tokenIndex) + } else { + const overflow = tokenIndex - WA.Tags.SINGLE_BYTE_MAX + const dictionaryIndex = overflow >> 8 + if (dictionaryIndex < 0 || dictionaryIndex > 3) { + throw 'double byte dict token out of range: ' + token + ', ' + tokenIndex + } + this.writeToken(WA.Tags.DICTIONARY_0 + dictionaryIndex) + this.writeToken(overflow % 256) + } + } else if (token) { + const jidSepIndex = token.indexOf('@') + if (jidSepIndex <= 0) { + this.writeStringRaw(token) + } else { + this.writeJid(token.slice(0, jidSepIndex), token.slice(jidSepIndex + 1, token.length)) + } + } + } + writeAttributes(attrs: Record | string, keys: string[]) { + if (!attrs) { + return + } + keys.forEach((key) => { + this.writeString(key) + this.writeString(attrs[key]) + }) + } + writeListStart(listSize: number) { + if (listSize === 0) { + this.pushByte(WA.Tags.LIST_EMPTY) + } else if (listSize < 256) { + this.pushBytes([WA.Tags.LIST_8, listSize]) + } else { + this.pushBytes([WA.Tags.LIST_16, listSize]) + } + } + writeChildren(children: string | Array | Object) { + if (!children) { + return + } + + if (typeof children === 'string') { + this.writeString(children, true) + } else if (Array.isArray(children)) { + this.writeListStart(children.length) + children.forEach((c) => { + if (c) this.writeNode(c) + }) + } else if (typeof children === 'object') { + const buffer = WA.Message.encode(children as proto.WebMessageInfo).finish() + this.writeByteLength(buffer.length) + this.pushBytes(buffer) + } else { + throw 'invalid children: ' + children + ' (' + typeof children + ')' + } + } + getValidKeys(obj: Object) { + return obj ? Object.keys(obj).filter((key) => obj[key] !== null && obj[key] !== undefined) : [] + } + writeNode(node: WA.Node) { + if (!node) { + return + } else if (node.length !== 3) { + throw 'invalid node given: ' + node + } + const validAttributes = this.getValidKeys(node[1]) + + this.writeListStart(2 * validAttributes.length + 1 + (node[2] ? 1 : 0)) + this.writeString(node[0]) + this.writeAttributes(node[1], validAttributes) + this.writeChildren(node[2]) + } + write(data) { + this.data = [] + this.writeNode(data) + + return Buffer.from(this.data) + } +} diff --git a/Binary/Tests.ts b/Binary/Tests.ts new file mode 100644 index 0000000..703089b --- /dev/null +++ b/Binary/Tests.ts @@ -0,0 +1,81 @@ +import { strict as assert } from 'assert' +import Encoder from './Encoder' +import Decoder from './Decoder' + +describe('Binary Coding Tests', () => { + const testVectors: [[string, Object]] = [ + [ + 'f806092f5a0a10f804f80234fc6c0a350a1b39313735323938373131313740732e77686174736170702e6e657410011a143345423030393637354537454433374141424632122b0a292a7069616e6f20726f6f6d2074696d696e6773206172653a2a0a20363a3030414d2d31323a3030414d18b3faa7f3052003f80234fc4c0a410a1b39313735323938373131313740732e77686174736170702e6e657410001a20304643454335333330463634393239433645394132434646443242433845414418bdfaa7f305c00101f80234fc930a350a1b39313735323938373131313740732e77686174736170702e6e657410011a14334542303033433742353339414644303937353312520a50536f727279206672656e2c204920636f756c646e277420756e6465727374616e6420274c69627261272e2054797065202768656c702720746f206b6e6f77207768617420616c6c20492063616e20646f18c1faa7f3052003f80234fc540a410a1b39313735323938373131313740732e77686174736170702e6e657410001a20413132333042384436423041314437393345433241453245413043313638443812090a076c69627261727918c2faa7f305', + [ + 'action', + { last: 'true', add: 'before' }, + [ + [ + 'message', + null, + { + key: { remoteJid: '917529871117@s.whatsapp.net', fromMe: true, id: '3EB009675E7ED37AABF2' }, + message: { conversation: '*piano room timings are:*\n 6:00AM-12:00AM' }, + messageTimestamp: '1584004403', + status: 'DELIVERY_ACK', + }, + ], + [ + 'message', + null, + { + key: { + remoteJid: '917529871117@s.whatsapp.net', + fromMe: false, + id: '0FCEC5330F64929C6E9A2CFFD2BC8EAD', + }, + messageTimestamp: '1584004413', + messageStubType: 'REVOKE', + }, + ], + [ + 'message', + null, + { + key: { remoteJid: '917529871117@s.whatsapp.net', fromMe: true, id: '3EB003C7B539AFD09753' }, + message: { + conversation: + "Sorry fren, I couldn't understand 'Libra'. Type 'help' to know what all I can do", + }, + messageTimestamp: '1584004417', + status: 'DELIVERY_ACK', + }, + ], + [ + 'message', + null, + { + key: { + remoteJid: '917529871117@s.whatsapp.net', + fromMe: false, + id: 'A1230B8D6B0A1D793EC2AE2EA0C168D8', + }, + message: { conversation: 'library' }, + messageTimestamp: '1584004418', + }, + ], + ], + ], + ], + ] + const encoder = new Encoder() + const decoder = new Decoder() + + it('should decode strings', () => { + testVectors.forEach((pair) => { + const buff = Buffer.from(pair[0], 'hex') + const decoded = decoder.read(buff) + + assert.deepEqual(JSON.stringify(decoded), JSON.stringify(pair[1])) + + const encoded = encoder.write(decoded) + assert.deepEqual(encoded, buff) + }) + console.log('all coding tests passed') + }) +}) diff --git a/Binary/WAMessage.d.ts b/Binary/WAMessage.d.ts new file mode 100644 index 0000000..7d72050 --- /dev/null +++ b/Binary/WAMessage.d.ts @@ -0,0 +1,6893 @@ +import * as $protobuf from 'protobufjs' +/** Namespace proto. */ +export namespace proto { + /** Properties of a HydratedQuickReplyButton. */ + interface IHydratedQuickReplyButton { + /** HydratedQuickReplyButton displayText */ + displayText?: string | null + + /** HydratedQuickReplyButton id */ + id?: string | null + } + + /** Represents a HydratedQuickReplyButton. */ + class HydratedQuickReplyButton implements IHydratedQuickReplyButton { + /** + * Constructs a new HydratedQuickReplyButton. + * @param [properties] Properties to set + */ + constructor(properties?: proto.IHydratedQuickReplyButton) + + /** HydratedQuickReplyButton displayText. */ + public displayText: string + + /** HydratedQuickReplyButton id. */ + public id: string + + /** + * Creates a new HydratedQuickReplyButton instance using the specified properties. + * @param [properties] Properties to set + * @returns HydratedQuickReplyButton instance + */ + public static create(properties?: proto.IHydratedQuickReplyButton): proto.HydratedQuickReplyButton + + /** + * Encodes the specified HydratedQuickReplyButton message. Does not implicitly {@link proto.HydratedQuickReplyButton.verify|verify} messages. + * @param message HydratedQuickReplyButton message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.IHydratedQuickReplyButton, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Encodes the specified HydratedQuickReplyButton message, length delimited. Does not implicitly {@link proto.HydratedQuickReplyButton.verify|verify} messages. + * @param message HydratedQuickReplyButton message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: proto.IHydratedQuickReplyButton, + writer?: $protobuf.Writer, + ): $protobuf.Writer + + /** + * Decodes a HydratedQuickReplyButton message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HydratedQuickReplyButton + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): proto.HydratedQuickReplyButton + + /** + * Decodes a HydratedQuickReplyButton message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HydratedQuickReplyButton + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): proto.HydratedQuickReplyButton + + /** + * Verifies a HydratedQuickReplyButton message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null + + /** + * Creates a HydratedQuickReplyButton message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HydratedQuickReplyButton + */ + public static fromObject(object: { [k: string]: any }): proto.HydratedQuickReplyButton + + /** + * Creates a plain object from a HydratedQuickReplyButton message. Also converts values to other types if specified. + * @param message HydratedQuickReplyButton + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: proto.HydratedQuickReplyButton, + options?: $protobuf.IConversionOptions, + ): { [k: string]: any } + + /** + * Converts this HydratedQuickReplyButton to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any } + } + + /** Properties of a HydratedURLButton. */ + interface IHydratedURLButton { + /** HydratedURLButton displayText */ + displayText?: string | null + + /** HydratedURLButton url */ + url?: string | null + } + + /** Represents a HydratedURLButton. */ + class HydratedURLButton implements IHydratedURLButton { + /** + * Constructs a new HydratedURLButton. + * @param [properties] Properties to set + */ + constructor(properties?: proto.IHydratedURLButton) + + /** HydratedURLButton displayText. */ + public displayText: string + + /** HydratedURLButton url. */ + public url: string + + /** + * Creates a new HydratedURLButton instance using the specified properties. + * @param [properties] Properties to set + * @returns HydratedURLButton instance + */ + public static create(properties?: proto.IHydratedURLButton): proto.HydratedURLButton + + /** + * Encodes the specified HydratedURLButton message. Does not implicitly {@link proto.HydratedURLButton.verify|verify} messages. + * @param message HydratedURLButton message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.IHydratedURLButton, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Encodes the specified HydratedURLButton message, length delimited. Does not implicitly {@link proto.HydratedURLButton.verify|verify} messages. + * @param message HydratedURLButton message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.IHydratedURLButton, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Decodes a HydratedURLButton message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HydratedURLButton + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): proto.HydratedURLButton + + /** + * Decodes a HydratedURLButton message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HydratedURLButton + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): proto.HydratedURLButton + + /** + * Verifies a HydratedURLButton message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null + + /** + * Creates a HydratedURLButton message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HydratedURLButton + */ + public static fromObject(object: { [k: string]: any }): proto.HydratedURLButton + + /** + * Creates a plain object from a HydratedURLButton message. Also converts values to other types if specified. + * @param message HydratedURLButton + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: proto.HydratedURLButton, + options?: $protobuf.IConversionOptions, + ): { [k: string]: any } + + /** + * Converts this HydratedURLButton to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any } + } + + /** Properties of a HydratedCallButton. */ + interface IHydratedCallButton { + /** HydratedCallButton displayText */ + displayText?: string | null + + /** HydratedCallButton phoneNumber */ + phoneNumber?: string | null + } + + /** Represents a HydratedCallButton. */ + class HydratedCallButton implements IHydratedCallButton { + /** + * Constructs a new HydratedCallButton. + * @param [properties] Properties to set + */ + constructor(properties?: proto.IHydratedCallButton) + + /** HydratedCallButton displayText. */ + public displayText: string + + /** HydratedCallButton phoneNumber. */ + public phoneNumber: string + + /** + * Creates a new HydratedCallButton instance using the specified properties. + * @param [properties] Properties to set + * @returns HydratedCallButton instance + */ + public static create(properties?: proto.IHydratedCallButton): proto.HydratedCallButton + + /** + * Encodes the specified HydratedCallButton message. Does not implicitly {@link proto.HydratedCallButton.verify|verify} messages. + * @param message HydratedCallButton message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.IHydratedCallButton, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Encodes the specified HydratedCallButton message, length delimited. Does not implicitly {@link proto.HydratedCallButton.verify|verify} messages. + * @param message HydratedCallButton message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.IHydratedCallButton, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Decodes a HydratedCallButton message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HydratedCallButton + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): proto.HydratedCallButton + + /** + * Decodes a HydratedCallButton message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HydratedCallButton + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): proto.HydratedCallButton + + /** + * Verifies a HydratedCallButton message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null + + /** + * Creates a HydratedCallButton message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HydratedCallButton + */ + public static fromObject(object: { [k: string]: any }): proto.HydratedCallButton + + /** + * Creates a plain object from a HydratedCallButton message. Also converts values to other types if specified. + * @param message HydratedCallButton + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: proto.HydratedCallButton, + options?: $protobuf.IConversionOptions, + ): { [k: string]: any } + + /** + * Converts this HydratedCallButton to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any } + } + + /** Properties of a HydratedTemplateButton. */ + interface IHydratedTemplateButton { + /** HydratedTemplateButton index */ + index?: number | null + + /** HydratedTemplateButton quickReplyButton */ + quickReplyButton?: proto.IHydratedQuickReplyButton | null + + /** HydratedTemplateButton urlButton */ + urlButton?: proto.IHydratedURLButton | null + + /** HydratedTemplateButton callButton */ + callButton?: proto.IHydratedCallButton | null + } + + /** Represents a HydratedTemplateButton. */ + class HydratedTemplateButton implements IHydratedTemplateButton { + /** + * Constructs a new HydratedTemplateButton. + * @param [properties] Properties to set + */ + constructor(properties?: proto.IHydratedTemplateButton) + + /** HydratedTemplateButton index. */ + public index: number + + /** HydratedTemplateButton quickReplyButton. */ + public quickReplyButton?: proto.IHydratedQuickReplyButton | null + + /** HydratedTemplateButton urlButton. */ + public urlButton?: proto.IHydratedURLButton | null + + /** HydratedTemplateButton callButton. */ + public callButton?: proto.IHydratedCallButton | null + + /** HydratedTemplateButton hydratedButton. */ + public hydratedButton?: 'quickReplyButton' | 'urlButton' | 'callButton' + + /** + * Creates a new HydratedTemplateButton instance using the specified properties. + * @param [properties] Properties to set + * @returns HydratedTemplateButton instance + */ + public static create(properties?: proto.IHydratedTemplateButton): proto.HydratedTemplateButton + + /** + * Encodes the specified HydratedTemplateButton message. Does not implicitly {@link proto.HydratedTemplateButton.verify|verify} messages. + * @param message HydratedTemplateButton message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.IHydratedTemplateButton, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Encodes the specified HydratedTemplateButton message, length delimited. Does not implicitly {@link proto.HydratedTemplateButton.verify|verify} messages. + * @param message HydratedTemplateButton message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: proto.IHydratedTemplateButton, + writer?: $protobuf.Writer, + ): $protobuf.Writer + + /** + * Decodes a HydratedTemplateButton message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HydratedTemplateButton + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): proto.HydratedTemplateButton + + /** + * Decodes a HydratedTemplateButton message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HydratedTemplateButton + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): proto.HydratedTemplateButton + + /** + * Verifies a HydratedTemplateButton message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null + + /** + * Creates a HydratedTemplateButton message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HydratedTemplateButton + */ + public static fromObject(object: { [k: string]: any }): proto.HydratedTemplateButton + + /** + * Creates a plain object from a HydratedTemplateButton message. Also converts values to other types if specified. + * @param message HydratedTemplateButton + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: proto.HydratedTemplateButton, + options?: $protobuf.IConversionOptions, + ): { [k: string]: any } + + /** + * Converts this HydratedTemplateButton to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any } + } + + /** Properties of a QuickReplyButton. */ + interface IQuickReplyButton { + /** QuickReplyButton displayText */ + displayText?: proto.IHighlyStructuredMessage | null + + /** QuickReplyButton id */ + id?: string | null + } + + /** Represents a QuickReplyButton. */ + class QuickReplyButton implements IQuickReplyButton { + /** + * Constructs a new QuickReplyButton. + * @param [properties] Properties to set + */ + constructor(properties?: proto.IQuickReplyButton) + + /** QuickReplyButton displayText. */ + public displayText?: proto.IHighlyStructuredMessage | null + + /** QuickReplyButton id. */ + public id: string + + /** + * Creates a new QuickReplyButton instance using the specified properties. + * @param [properties] Properties to set + * @returns QuickReplyButton instance + */ + public static create(properties?: proto.IQuickReplyButton): proto.QuickReplyButton + + /** + * Encodes the specified QuickReplyButton message. Does not implicitly {@link proto.QuickReplyButton.verify|verify} messages. + * @param message QuickReplyButton message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.IQuickReplyButton, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Encodes the specified QuickReplyButton message, length delimited. Does not implicitly {@link proto.QuickReplyButton.verify|verify} messages. + * @param message QuickReplyButton message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.IQuickReplyButton, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Decodes a QuickReplyButton message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QuickReplyButton + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): proto.QuickReplyButton + + /** + * Decodes a QuickReplyButton message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QuickReplyButton + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): proto.QuickReplyButton + + /** + * Verifies a QuickReplyButton message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null + + /** + * Creates a QuickReplyButton message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QuickReplyButton + */ + public static fromObject(object: { [k: string]: any }): proto.QuickReplyButton + + /** + * Creates a plain object from a QuickReplyButton message. Also converts values to other types if specified. + * @param message QuickReplyButton + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: proto.QuickReplyButton, + options?: $protobuf.IConversionOptions, + ): { [k: string]: any } + + /** + * Converts this QuickReplyButton to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any } + } + + /** Properties of a URLButton. */ + interface IURLButton { + /** URLButton displayText */ + displayText?: proto.IHighlyStructuredMessage | null + + /** URLButton url */ + url?: proto.IHighlyStructuredMessage | null + } + + /** Represents a URLButton. */ + class URLButton implements IURLButton { + /** + * Constructs a new URLButton. + * @param [properties] Properties to set + */ + constructor(properties?: proto.IURLButton) + + /** URLButton displayText. */ + public displayText?: proto.IHighlyStructuredMessage | null + + /** URLButton url. */ + public url?: proto.IHighlyStructuredMessage | null + + /** + * Creates a new URLButton instance using the specified properties. + * @param [properties] Properties to set + * @returns URLButton instance + */ + public static create(properties?: proto.IURLButton): proto.URLButton + + /** + * Encodes the specified URLButton message. Does not implicitly {@link proto.URLButton.verify|verify} messages. + * @param message URLButton message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.IURLButton, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Encodes the specified URLButton message, length delimited. Does not implicitly {@link proto.URLButton.verify|verify} messages. + * @param message URLButton message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.IURLButton, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Decodes a URLButton message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns URLButton + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): proto.URLButton + + /** + * Decodes a URLButton message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns URLButton + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): proto.URLButton + + /** + * Verifies a URLButton message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null + + /** + * Creates a URLButton message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns URLButton + */ + public static fromObject(object: { [k: string]: any }): proto.URLButton + + /** + * Creates a plain object from a URLButton message. Also converts values to other types if specified. + * @param message URLButton + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: proto.URLButton, options?: $protobuf.IConversionOptions): { [k: string]: any } + + /** + * Converts this URLButton to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any } + } + + /** Properties of a CallButton. */ + interface ICallButton { + /** CallButton displayText */ + displayText?: proto.IHighlyStructuredMessage | null + + /** CallButton phoneNumber */ + phoneNumber?: proto.IHighlyStructuredMessage | null + } + + /** Represents a CallButton. */ + class CallButton implements ICallButton { + /** + * Constructs a new CallButton. + * @param [properties] Properties to set + */ + constructor(properties?: proto.ICallButton) + + /** CallButton displayText. */ + public displayText?: proto.IHighlyStructuredMessage | null + + /** CallButton phoneNumber. */ + public phoneNumber?: proto.IHighlyStructuredMessage | null + + /** + * Creates a new CallButton instance using the specified properties. + * @param [properties] Properties to set + * @returns CallButton instance + */ + public static create(properties?: proto.ICallButton): proto.CallButton + + /** + * Encodes the specified CallButton message. Does not implicitly {@link proto.CallButton.verify|verify} messages. + * @param message CallButton message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.ICallButton, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Encodes the specified CallButton message, length delimited. Does not implicitly {@link proto.CallButton.verify|verify} messages. + * @param message CallButton message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.ICallButton, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Decodes a CallButton message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CallButton + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): proto.CallButton + + /** + * Decodes a CallButton message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CallButton + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): proto.CallButton + + /** + * Verifies a CallButton message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null + + /** + * Creates a CallButton message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CallButton + */ + public static fromObject(object: { [k: string]: any }): proto.CallButton + + /** + * Creates a plain object from a CallButton message. Also converts values to other types if specified. + * @param message CallButton + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: proto.CallButton, options?: $protobuf.IConversionOptions): { [k: string]: any } + + /** + * Converts this CallButton to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any } + } + + /** Properties of a TemplateButton. */ + interface ITemplateButton { + /** TemplateButton index */ + index?: number | null + + /** TemplateButton quickReplyButton */ + quickReplyButton?: proto.IQuickReplyButton | null + + /** TemplateButton urlButton */ + urlButton?: proto.IURLButton | null + + /** TemplateButton callButton */ + callButton?: proto.ICallButton | null + } + + /** Represents a TemplateButton. */ + class TemplateButton implements ITemplateButton { + /** + * Constructs a new TemplateButton. + * @param [properties] Properties to set + */ + constructor(properties?: proto.ITemplateButton) + + /** TemplateButton index. */ + public index: number + + /** TemplateButton quickReplyButton. */ + public quickReplyButton?: proto.IQuickReplyButton | null + + /** TemplateButton urlButton. */ + public urlButton?: proto.IURLButton | null + + /** TemplateButton callButton. */ + public callButton?: proto.ICallButton | null + + /** TemplateButton button. */ + public button?: 'quickReplyButton' | 'urlButton' | 'callButton' + + /** + * Creates a new TemplateButton instance using the specified properties. + * @param [properties] Properties to set + * @returns TemplateButton instance + */ + public static create(properties?: proto.ITemplateButton): proto.TemplateButton + + /** + * Encodes the specified TemplateButton message. Does not implicitly {@link proto.TemplateButton.verify|verify} messages. + * @param message TemplateButton message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.ITemplateButton, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Encodes the specified TemplateButton message, length delimited. Does not implicitly {@link proto.TemplateButton.verify|verify} messages. + * @param message TemplateButton message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.ITemplateButton, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Decodes a TemplateButton message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TemplateButton + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): proto.TemplateButton + + /** + * Decodes a TemplateButton message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TemplateButton + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): proto.TemplateButton + + /** + * Verifies a TemplateButton message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null + + /** + * Creates a TemplateButton message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TemplateButton + */ + public static fromObject(object: { [k: string]: any }): proto.TemplateButton + + /** + * Creates a plain object from a TemplateButton message. Also converts values to other types if specified. + * @param message TemplateButton + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: proto.TemplateButton, + options?: $protobuf.IConversionOptions, + ): { [k: string]: any } + + /** + * Converts this TemplateButton to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any } + } + + /** Properties of a Location. */ + interface ILocation { + /** Location degreesLatitude */ + degreesLatitude?: number | null + + /** Location degreesLongitude */ + degreesLongitude?: number | null + + /** Location name */ + name?: string | null + } + + /** Represents a Location. */ + class Location implements ILocation { + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: proto.ILocation) + + /** Location degreesLatitude. */ + public degreesLatitude: number + + /** Location degreesLongitude. */ + public degreesLongitude: number + + /** Location name. */ + public name: string + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: proto.ILocation): proto.Location + + /** + * Encodes the specified Location message. Does not implicitly {@link proto.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.ILocation, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link proto.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.ILocation, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): proto.Location + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): proto.Location + + /** + * Verifies a Location message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): proto.Location + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: proto.Location, options?: $protobuf.IConversionOptions): { [k: string]: any } + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any } + } + + /** Properties of a Point. */ + interface IPoint { + /** Point x */ + x?: number | null + + /** Point y */ + y?: number | null + } + + /** Represents a Point. */ + class Point implements IPoint { + /** + * Constructs a new Point. + * @param [properties] Properties to set + */ + constructor(properties?: proto.IPoint) + + /** Point x. */ + public x: number + + /** Point y. */ + public y: number + + /** + * Creates a new Point instance using the specified properties. + * @param [properties] Properties to set + * @returns Point instance + */ + public static create(properties?: proto.IPoint): proto.Point + + /** + * Encodes the specified Point message. Does not implicitly {@link proto.Point.verify|verify} messages. + * @param message Point message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.IPoint, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Encodes the specified Point message, length delimited. Does not implicitly {@link proto.Point.verify|verify} messages. + * @param message Point message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.IPoint, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Decodes a Point message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Point + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): proto.Point + + /** + * Decodes a Point message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Point + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): proto.Point + + /** + * Verifies a Point message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null + + /** + * Creates a Point message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Point + */ + public static fromObject(object: { [k: string]: any }): proto.Point + + /** + * Creates a plain object from a Point message. Also converts values to other types if specified. + * @param message Point + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: proto.Point, options?: $protobuf.IConversionOptions): { [k: string]: any } + + /** + * Converts this Point to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any } + } + + /** Properties of an InteractiveAnnotation. */ + interface IInteractiveAnnotation { + /** InteractiveAnnotation polygonVertices */ + polygonVertices?: proto.IPoint[] | null + + /** InteractiveAnnotation location */ + location?: proto.ILocation | null + } + + /** Represents an InteractiveAnnotation. */ + class InteractiveAnnotation implements IInteractiveAnnotation { + /** + * Constructs a new InteractiveAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: proto.IInteractiveAnnotation) + + /** InteractiveAnnotation polygonVertices. */ + public polygonVertices: proto.IPoint[] + + /** InteractiveAnnotation location. */ + public location?: proto.ILocation | null + + /** InteractiveAnnotation action. */ + public action?: 'location' + + /** + * Creates a new InteractiveAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns InteractiveAnnotation instance + */ + public static create(properties?: proto.IInteractiveAnnotation): proto.InteractiveAnnotation + + /** + * Encodes the specified InteractiveAnnotation message. Does not implicitly {@link proto.InteractiveAnnotation.verify|verify} messages. + * @param message InteractiveAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.IInteractiveAnnotation, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Encodes the specified InteractiveAnnotation message, length delimited. Does not implicitly {@link proto.InteractiveAnnotation.verify|verify} messages. + * @param message InteractiveAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: proto.IInteractiveAnnotation, + writer?: $protobuf.Writer, + ): $protobuf.Writer + + /** + * Decodes an InteractiveAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InteractiveAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): proto.InteractiveAnnotation + + /** + * Decodes an InteractiveAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InteractiveAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): proto.InteractiveAnnotation + + /** + * Verifies an InteractiveAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null + + /** + * Creates an InteractiveAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InteractiveAnnotation + */ + public static fromObject(object: { [k: string]: any }): proto.InteractiveAnnotation + + /** + * Creates a plain object from an InteractiveAnnotation message. Also converts values to other types if specified. + * @param message InteractiveAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: proto.InteractiveAnnotation, + options?: $protobuf.IConversionOptions, + ): { [k: string]: any } + + /** + * Converts this InteractiveAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any } + } + + /** Properties of an AdReplyInfo. */ + interface IAdReplyInfo { + /** AdReplyInfo advertiserName */ + advertiserName?: string | null + + /** AdReplyInfo mediaType */ + mediaType?: proto.AdReplyInfo.AD_REPLY_INFO_MEDIATYPE | null + + /** AdReplyInfo jpegThumbnail */ + jpegThumbnail?: Uint8Array | null + + /** AdReplyInfo caption */ + caption?: string | null + } + + /** Represents an AdReplyInfo. */ + class AdReplyInfo implements IAdReplyInfo { + /** + * Constructs a new AdReplyInfo. + * @param [properties] Properties to set + */ + constructor(properties?: proto.IAdReplyInfo) + + /** AdReplyInfo advertiserName. */ + public advertiserName: string + + /** AdReplyInfo mediaType. */ + public mediaType: proto.AdReplyInfo.AD_REPLY_INFO_MEDIATYPE + + /** AdReplyInfo jpegThumbnail. */ + public jpegThumbnail: Uint8Array + + /** AdReplyInfo caption. */ + public caption: string + + /** + * Creates a new AdReplyInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns AdReplyInfo instance + */ + public static create(properties?: proto.IAdReplyInfo): proto.AdReplyInfo + + /** + * Encodes the specified AdReplyInfo message. Does not implicitly {@link proto.AdReplyInfo.verify|verify} messages. + * @param message AdReplyInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.IAdReplyInfo, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Encodes the specified AdReplyInfo message, length delimited. Does not implicitly {@link proto.AdReplyInfo.verify|verify} messages. + * @param message AdReplyInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.IAdReplyInfo, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Decodes an AdReplyInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AdReplyInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): proto.AdReplyInfo + + /** + * Decodes an AdReplyInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AdReplyInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): proto.AdReplyInfo + + /** + * Verifies an AdReplyInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null + + /** + * Creates an AdReplyInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AdReplyInfo + */ + public static fromObject(object: { [k: string]: any }): proto.AdReplyInfo + + /** + * Creates a plain object from an AdReplyInfo message. Also converts values to other types if specified. + * @param message AdReplyInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: proto.AdReplyInfo, options?: $protobuf.IConversionOptions): { [k: string]: any } + + /** + * Converts this AdReplyInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any } + } + + namespace AdReplyInfo { + /** AD_REPLY_INFO_MEDIATYPE enum. */ + enum AD_REPLY_INFO_MEDIATYPE { + NONE = 0, + IMAGE = 1, + VIDEO = 2, + } + } + + /** Properties of a ContextInfo. */ + interface IContextInfo { + /** ContextInfo stanzaId */ + stanzaId?: string | null + + /** ContextInfo participant */ + participant?: string | null + + /** ContextInfo quotedMessage */ + quotedMessage?: proto.IMessage | null + + /** ContextInfo remoteJid */ + remoteJid?: string | null + + /** ContextInfo mentionedJid */ + mentionedJid?: string[] | null + + /** ContextInfo conversionSource */ + conversionSource?: string | null + + /** ContextInfo conversionData */ + conversionData?: Uint8Array | null + + /** ContextInfo conversionDelaySeconds */ + conversionDelaySeconds?: number | null + + /** ContextInfo forwardingScore */ + forwardingScore?: number | null + + /** ContextInfo isForwarded */ + isForwarded?: boolean | null + + /** ContextInfo quotedAd */ + quotedAd?: proto.IAdReplyInfo | null + + /** ContextInfo placeholderKey */ + placeholderKey?: proto.IMessageKey | null + + /** ContextInfo expiration */ + expiration?: number | null + } + + /** Represents a ContextInfo. */ + class ContextInfo implements IContextInfo { + /** + * Constructs a new ContextInfo. + * @param [properties] Properties to set + */ + constructor(properties?: proto.IContextInfo) + + /** ContextInfo stanzaId. */ + public stanzaId: string + + /** ContextInfo participant. */ + public participant: string + + /** ContextInfo quotedMessage. */ + public quotedMessage?: proto.IMessage | null + + /** ContextInfo remoteJid. */ + public remoteJid: string + + /** ContextInfo mentionedJid. */ + public mentionedJid: string[] + + /** ContextInfo conversionSource. */ + public conversionSource: string + + /** ContextInfo conversionData. */ + public conversionData: Uint8Array + + /** ContextInfo conversionDelaySeconds. */ + public conversionDelaySeconds: number + + /** ContextInfo forwardingScore. */ + public forwardingScore: number + + /** ContextInfo isForwarded. */ + public isForwarded: boolean + + /** ContextInfo quotedAd. */ + public quotedAd?: proto.IAdReplyInfo | null + + /** ContextInfo placeholderKey. */ + public placeholderKey?: proto.IMessageKey | null + + /** ContextInfo expiration. */ + public expiration: number + + /** + * Creates a new ContextInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns ContextInfo instance + */ + public static create(properties?: proto.IContextInfo): proto.ContextInfo + + /** + * Encodes the specified ContextInfo message. Does not implicitly {@link proto.ContextInfo.verify|verify} messages. + * @param message ContextInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.IContextInfo, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Encodes the specified ContextInfo message, length delimited. Does not implicitly {@link proto.ContextInfo.verify|verify} messages. + * @param message ContextInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.IContextInfo, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Decodes a ContextInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ContextInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): proto.ContextInfo + + /** + * Decodes a ContextInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ContextInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): proto.ContextInfo + + /** + * Verifies a ContextInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null + + /** + * Creates a ContextInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ContextInfo + */ + public static fromObject(object: { [k: string]: any }): proto.ContextInfo + + /** + * Creates a plain object from a ContextInfo message. Also converts values to other types if specified. + * @param message ContextInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: proto.ContextInfo, options?: $protobuf.IConversionOptions): { [k: string]: any } + + /** + * Converts this ContextInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any } + } + + /** Properties of a SenderKeyDistributionMessage. */ + interface ISenderKeyDistributionMessage { + /** SenderKeyDistributionMessage groupId */ + groupId?: string | null + + /** SenderKeyDistributionMessage axolotlSenderKeyDistributionMessage */ + axolotlSenderKeyDistributionMessage?: Uint8Array | null + } + + /** Represents a SenderKeyDistributionMessage. */ + class SenderKeyDistributionMessage implements ISenderKeyDistributionMessage { + /** + * Constructs a new SenderKeyDistributionMessage. + * @param [properties] Properties to set + */ + constructor(properties?: proto.ISenderKeyDistributionMessage) + + /** SenderKeyDistributionMessage groupId. */ + public groupId: string + + /** SenderKeyDistributionMessage axolotlSenderKeyDistributionMessage. */ + public axolotlSenderKeyDistributionMessage: Uint8Array + + /** + * Creates a new SenderKeyDistributionMessage instance using the specified properties. + * @param [properties] Properties to set + * @returns SenderKeyDistributionMessage instance + */ + public static create(properties?: proto.ISenderKeyDistributionMessage): proto.SenderKeyDistributionMessage + + /** + * Encodes the specified SenderKeyDistributionMessage message. Does not implicitly {@link proto.SenderKeyDistributionMessage.verify|verify} messages. + * @param message SenderKeyDistributionMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.ISenderKeyDistributionMessage, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Encodes the specified SenderKeyDistributionMessage message, length delimited. Does not implicitly {@link proto.SenderKeyDistributionMessage.verify|verify} messages. + * @param message SenderKeyDistributionMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: proto.ISenderKeyDistributionMessage, + writer?: $protobuf.Writer, + ): $protobuf.Writer + + /** + * Decodes a SenderKeyDistributionMessage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SenderKeyDistributionMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): proto.SenderKeyDistributionMessage + + /** + * Decodes a SenderKeyDistributionMessage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SenderKeyDistributionMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): proto.SenderKeyDistributionMessage + + /** + * Verifies a SenderKeyDistributionMessage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null + + /** + * Creates a SenderKeyDistributionMessage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SenderKeyDistributionMessage + */ + public static fromObject(object: { [k: string]: any }): proto.SenderKeyDistributionMessage + + /** + * Creates a plain object from a SenderKeyDistributionMessage message. Also converts values to other types if specified. + * @param message SenderKeyDistributionMessage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: proto.SenderKeyDistributionMessage, + options?: $protobuf.IConversionOptions, + ): { [k: string]: any } + + /** + * Converts this SenderKeyDistributionMessage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any } + } + + /** Properties of an ImageMessage. */ + interface IImageMessage { + /** ImageMessage url */ + url?: string | null + + /** ImageMessage mimetype */ + mimetype?: string | null + + /** ImageMessage caption */ + caption?: string | null + + /** ImageMessage fileSha256 */ + fileSha256?: Uint8Array | null + + /** ImageMessage fileLength */ + fileLength?: number | Long | null + + /** ImageMessage height */ + height?: number | null + + /** ImageMessage width */ + width?: number | null + + /** ImageMessage mediaKey */ + mediaKey?: Uint8Array | null + + /** ImageMessage fileEncSha256 */ + fileEncSha256?: Uint8Array | null + + /** ImageMessage interactiveAnnotations */ + interactiveAnnotations?: proto.IInteractiveAnnotation[] | null + + /** ImageMessage directPath */ + directPath?: string | null + + /** ImageMessage mediaKeyTimestamp */ + mediaKeyTimestamp?: number | Long | null + + /** ImageMessage jpegThumbnail */ + jpegThumbnail?: Uint8Array | null + + /** ImageMessage contextInfo */ + contextInfo?: proto.IContextInfo | null + + /** ImageMessage firstScanSidecar */ + firstScanSidecar?: Uint8Array | null + + /** ImageMessage firstScanLength */ + firstScanLength?: number | null + + /** ImageMessage experimentGroupId */ + experimentGroupId?: number | null + + /** ImageMessage scansSidecar */ + scansSidecar?: Uint8Array | null + + /** ImageMessage scanLengths */ + scanLengths?: number[] | null + + /** ImageMessage midQualityFileSha256 */ + midQualityFileSha256?: Uint8Array | null + + /** ImageMessage midQualityFileEncSha256 */ + midQualityFileEncSha256?: Uint8Array | null + } + + /** Represents an ImageMessage. */ + class ImageMessage implements IImageMessage { + /** + * Constructs a new ImageMessage. + * @param [properties] Properties to set + */ + constructor(properties?: proto.IImageMessage) + + /** ImageMessage url. */ + public url: string + + /** ImageMessage mimetype. */ + public mimetype: string + + /** ImageMessage caption. */ + public caption: string + + /** ImageMessage fileSha256. */ + public fileSha256: Uint8Array + + /** ImageMessage fileLength. */ + public fileLength: number | Long + + /** ImageMessage height. */ + public height: number + + /** ImageMessage width. */ + public width: number + + /** ImageMessage mediaKey. */ + public mediaKey: Uint8Array + + /** ImageMessage fileEncSha256. */ + public fileEncSha256: Uint8Array + + /** ImageMessage interactiveAnnotations. */ + public interactiveAnnotations: proto.IInteractiveAnnotation[] + + /** ImageMessage directPath. */ + public directPath: string + + /** ImageMessage mediaKeyTimestamp. */ + public mediaKeyTimestamp: number | Long + + /** ImageMessage jpegThumbnail. */ + public jpegThumbnail: Uint8Array + + /** ImageMessage contextInfo. */ + public contextInfo?: proto.IContextInfo | null + + /** ImageMessage firstScanSidecar. */ + public firstScanSidecar: Uint8Array + + /** ImageMessage firstScanLength. */ + public firstScanLength: number + + /** ImageMessage experimentGroupId. */ + public experimentGroupId: number + + /** ImageMessage scansSidecar. */ + public scansSidecar: Uint8Array + + /** ImageMessage scanLengths. */ + public scanLengths: number[] + + /** ImageMessage midQualityFileSha256. */ + public midQualityFileSha256: Uint8Array + + /** ImageMessage midQualityFileEncSha256. */ + public midQualityFileEncSha256: Uint8Array + + /** + * Creates a new ImageMessage instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageMessage instance + */ + public static create(properties?: proto.IImageMessage): proto.ImageMessage + + /** + * Encodes the specified ImageMessage message. Does not implicitly {@link proto.ImageMessage.verify|verify} messages. + * @param message ImageMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.IImageMessage, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Encodes the specified ImageMessage message, length delimited. Does not implicitly {@link proto.ImageMessage.verify|verify} messages. + * @param message ImageMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.IImageMessage, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Decodes an ImageMessage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): proto.ImageMessage + + /** + * Decodes an ImageMessage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): proto.ImageMessage + + /** + * Verifies an ImageMessage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null + + /** + * Creates an ImageMessage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageMessage + */ + public static fromObject(object: { [k: string]: any }): proto.ImageMessage + + /** + * Creates a plain object from an ImageMessage message. Also converts values to other types if specified. + * @param message ImageMessage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: proto.ImageMessage, + options?: $protobuf.IConversionOptions, + ): { [k: string]: any } + + /** + * Converts this ImageMessage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any } + } + + /** Properties of a ContactMessage. */ + interface IContactMessage { + /** ContactMessage displayName */ + displayName?: string | null + + /** ContactMessage vcard */ + vcard?: string | null + + /** ContactMessage contextInfo */ + contextInfo?: proto.IContextInfo | null + } + + /** Represents a ContactMessage. */ + class ContactMessage implements IContactMessage { + /** + * Constructs a new ContactMessage. + * @param [properties] Properties to set + */ + constructor(properties?: proto.IContactMessage) + + /** ContactMessage displayName. */ + public displayName: string + + /** ContactMessage vcard. */ + public vcard: string + + /** ContactMessage contextInfo. */ + public contextInfo?: proto.IContextInfo | null + + /** + * Creates a new ContactMessage instance using the specified properties. + * @param [properties] Properties to set + * @returns ContactMessage instance + */ + public static create(properties?: proto.IContactMessage): proto.ContactMessage + + /** + * Encodes the specified ContactMessage message. Does not implicitly {@link proto.ContactMessage.verify|verify} messages. + * @param message ContactMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.IContactMessage, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Encodes the specified ContactMessage message, length delimited. Does not implicitly {@link proto.ContactMessage.verify|verify} messages. + * @param message ContactMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.IContactMessage, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Decodes a ContactMessage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ContactMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): proto.ContactMessage + + /** + * Decodes a ContactMessage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ContactMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): proto.ContactMessage + + /** + * Verifies a ContactMessage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null + + /** + * Creates a ContactMessage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ContactMessage + */ + public static fromObject(object: { [k: string]: any }): proto.ContactMessage + + /** + * Creates a plain object from a ContactMessage message. Also converts values to other types if specified. + * @param message ContactMessage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: proto.ContactMessage, + options?: $protobuf.IConversionOptions, + ): { [k: string]: any } + + /** + * Converts this ContactMessage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any } + } + + /** Properties of a LocationMessage. */ + interface ILocationMessage { + /** LocationMessage degreesLatitude */ + degreesLatitude?: number | null + + /** LocationMessage degreesLongitude */ + degreesLongitude?: number | null + + /** LocationMessage name */ + name?: string | null + + /** LocationMessage address */ + address?: string | null + + /** LocationMessage url */ + url?: string | null + + /** LocationMessage jpegThumbnail */ + jpegThumbnail?: Uint8Array | null + + /** LocationMessage contextInfo */ + contextInfo?: proto.IContextInfo | null + } + + /** Represents a LocationMessage. */ + class LocationMessage implements ILocationMessage { + /** + * Constructs a new LocationMessage. + * @param [properties] Properties to set + */ + constructor(properties?: proto.ILocationMessage) + + /** LocationMessage degreesLatitude. */ + public degreesLatitude: number + + /** LocationMessage degreesLongitude. */ + public degreesLongitude: number + + /** LocationMessage name. */ + public name: string + + /** LocationMessage address. */ + public address: string + + /** LocationMessage url. */ + public url: string + + /** LocationMessage jpegThumbnail. */ + public jpegThumbnail: Uint8Array + + /** LocationMessage contextInfo. */ + public contextInfo?: proto.IContextInfo | null + + /** + * Creates a new LocationMessage instance using the specified properties. + * @param [properties] Properties to set + * @returns LocationMessage instance + */ + public static create(properties?: proto.ILocationMessage): proto.LocationMessage + + /** + * Encodes the specified LocationMessage message. Does not implicitly {@link proto.LocationMessage.verify|verify} messages. + * @param message LocationMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.ILocationMessage, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Encodes the specified LocationMessage message, length delimited. Does not implicitly {@link proto.LocationMessage.verify|verify} messages. + * @param message LocationMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.ILocationMessage, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Decodes a LocationMessage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LocationMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): proto.LocationMessage + + /** + * Decodes a LocationMessage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LocationMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): proto.LocationMessage + + /** + * Verifies a LocationMessage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null + + /** + * Creates a LocationMessage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LocationMessage + */ + public static fromObject(object: { [k: string]: any }): proto.LocationMessage + + /** + * Creates a plain object from a LocationMessage message. Also converts values to other types if specified. + * @param message LocationMessage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: proto.LocationMessage, + options?: $protobuf.IConversionOptions, + ): { [k: string]: any } + + /** + * Converts this LocationMessage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any } + } + + /** Properties of an ExtendedTextMessage. */ + interface IExtendedTextMessage { + /** ExtendedTextMessage text */ + text?: string | null + + /** ExtendedTextMessage matchedText */ + matchedText?: string | null + + /** ExtendedTextMessage canonicalUrl */ + canonicalUrl?: string | null + + /** ExtendedTextMessage description */ + description?: string | null + + /** ExtendedTextMessage title */ + title?: string | null + + /** ExtendedTextMessage textArgb */ + textArgb?: number | null + + /** ExtendedTextMessage backgroundArgb */ + backgroundArgb?: number | null + + /** ExtendedTextMessage font */ + font?: proto.ExtendedTextMessage.EXTENDED_TEXT_MESSAGE_FONTTYPE | null + + /** ExtendedTextMessage previewType */ + previewType?: proto.ExtendedTextMessage.EXTENDED_TEXT_MESSAGE_PREVIEWTYPE | null + + /** ExtendedTextMessage jpegThumbnail */ + jpegThumbnail?: Uint8Array | null + + /** ExtendedTextMessage contextInfo */ + contextInfo?: proto.IContextInfo | null + + /** ExtendedTextMessage doNotPlayInline */ + doNotPlayInline?: boolean | null + } + + /** Represents an ExtendedTextMessage. */ + class ExtendedTextMessage implements IExtendedTextMessage { + /** + * Constructs a new ExtendedTextMessage. + * @param [properties] Properties to set + */ + constructor(properties?: proto.IExtendedTextMessage) + + /** ExtendedTextMessage text. */ + public text: string + + /** ExtendedTextMessage matchedText. */ + public matchedText: string + + /** ExtendedTextMessage canonicalUrl. */ + public canonicalUrl: string + + /** ExtendedTextMessage description. */ + public description: string + + /** ExtendedTextMessage title. */ + public title: string + + /** ExtendedTextMessage textArgb. */ + public textArgb: number + + /** ExtendedTextMessage backgroundArgb. */ + public backgroundArgb: number + + /** ExtendedTextMessage font. */ + public font: proto.ExtendedTextMessage.EXTENDED_TEXT_MESSAGE_FONTTYPE + + /** ExtendedTextMessage previewType. */ + public previewType: proto.ExtendedTextMessage.EXTENDED_TEXT_MESSAGE_PREVIEWTYPE + + /** ExtendedTextMessage jpegThumbnail. */ + public jpegThumbnail: Uint8Array + + /** ExtendedTextMessage contextInfo. */ + public contextInfo?: proto.IContextInfo | null + + /** ExtendedTextMessage doNotPlayInline. */ + public doNotPlayInline: boolean + + /** + * Creates a new ExtendedTextMessage instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtendedTextMessage instance + */ + public static create(properties?: proto.IExtendedTextMessage): proto.ExtendedTextMessage + + /** + * Encodes the specified ExtendedTextMessage message. Does not implicitly {@link proto.ExtendedTextMessage.verify|verify} messages. + * @param message ExtendedTextMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.IExtendedTextMessage, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Encodes the specified ExtendedTextMessage message, length delimited. Does not implicitly {@link proto.ExtendedTextMessage.verify|verify} messages. + * @param message ExtendedTextMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.IExtendedTextMessage, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Decodes an ExtendedTextMessage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtendedTextMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): proto.ExtendedTextMessage + + /** + * Decodes an ExtendedTextMessage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtendedTextMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): proto.ExtendedTextMessage + + /** + * Verifies an ExtendedTextMessage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null + + /** + * Creates an ExtendedTextMessage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtendedTextMessage + */ + public static fromObject(object: { [k: string]: any }): proto.ExtendedTextMessage + + /** + * Creates a plain object from an ExtendedTextMessage message. Also converts values to other types if specified. + * @param message ExtendedTextMessage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: proto.ExtendedTextMessage, + options?: $protobuf.IConversionOptions, + ): { [k: string]: any } + + /** + * Converts this ExtendedTextMessage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any } + } + + namespace ExtendedTextMessage { + /** EXTENDED_TEXT_MESSAGE_FONTTYPE enum. */ + enum EXTENDED_TEXT_MESSAGE_FONTTYPE { + SANS_SERIF = 0, + SERIF = 1, + NORICAN_REGULAR = 2, + BRYNDAN_WRITE = 3, + BEBASNEUE_REGULAR = 4, + OSWALD_HEAVY = 5, + } + + /** EXTENDED_TEXT_MESSAGE_PREVIEWTYPE enum. */ + enum EXTENDED_TEXT_MESSAGE_PREVIEWTYPE { + NONE = 0, + VIDEO = 1, + } + } + + /** Properties of a DocumentMessage. */ + interface IDocumentMessage { + /** DocumentMessage url */ + url?: string | null + + /** DocumentMessage mimetype */ + mimetype?: string | null + + /** DocumentMessage title */ + title?: string | null + + /** DocumentMessage fileSha256 */ + fileSha256?: Uint8Array | null + + /** DocumentMessage fileLength */ + fileLength?: number | Long | null + + /** DocumentMessage pageCount */ + pageCount?: number | null + + /** DocumentMessage mediaKey */ + mediaKey?: Uint8Array | null + + /** DocumentMessage fileName */ + fileName?: string | null + + /** DocumentMessage fileEncSha256 */ + fileEncSha256?: Uint8Array | null + + /** DocumentMessage directPath */ + directPath?: string | null + + /** DocumentMessage mediaKeyTimestamp */ + mediaKeyTimestamp?: number | Long | null + + /** DocumentMessage jpegThumbnail */ + jpegThumbnail?: Uint8Array | null + + /** DocumentMessage contextInfo */ + contextInfo?: proto.IContextInfo | null + } + + /** Represents a DocumentMessage. */ + class DocumentMessage implements IDocumentMessage { + /** + * Constructs a new DocumentMessage. + * @param [properties] Properties to set + */ + constructor(properties?: proto.IDocumentMessage) + + /** DocumentMessage url. */ + public url: string + + /** DocumentMessage mimetype. */ + public mimetype: string + + /** DocumentMessage title. */ + public title: string + + /** DocumentMessage fileSha256. */ + public fileSha256: Uint8Array + + /** DocumentMessage fileLength. */ + public fileLength: number | Long + + /** DocumentMessage pageCount. */ + public pageCount: number + + /** DocumentMessage mediaKey. */ + public mediaKey: Uint8Array + + /** DocumentMessage fileName. */ + public fileName: string + + /** DocumentMessage fileEncSha256. */ + public fileEncSha256: Uint8Array + + /** DocumentMessage directPath. */ + public directPath: string + + /** DocumentMessage mediaKeyTimestamp. */ + public mediaKeyTimestamp: number | Long + + /** DocumentMessage jpegThumbnail. */ + public jpegThumbnail: Uint8Array + + /** DocumentMessage contextInfo. */ + public contextInfo?: proto.IContextInfo | null + + /** + * Creates a new DocumentMessage instance using the specified properties. + * @param [properties] Properties to set + * @returns DocumentMessage instance + */ + public static create(properties?: proto.IDocumentMessage): proto.DocumentMessage + + /** + * Encodes the specified DocumentMessage message. Does not implicitly {@link proto.DocumentMessage.verify|verify} messages. + * @param message DocumentMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.IDocumentMessage, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Encodes the specified DocumentMessage message, length delimited. Does not implicitly {@link proto.DocumentMessage.verify|verify} messages. + * @param message DocumentMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.IDocumentMessage, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Decodes a DocumentMessage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DocumentMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): proto.DocumentMessage + + /** + * Decodes a DocumentMessage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DocumentMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): proto.DocumentMessage + + /** + * Verifies a DocumentMessage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null + + /** + * Creates a DocumentMessage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DocumentMessage + */ + public static fromObject(object: { [k: string]: any }): proto.DocumentMessage + + /** + * Creates a plain object from a DocumentMessage message. Also converts values to other types if specified. + * @param message DocumentMessage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: proto.DocumentMessage, + options?: $protobuf.IConversionOptions, + ): { [k: string]: any } + + /** + * Converts this DocumentMessage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any } + } + + /** Properties of an AudioMessage. */ + interface IAudioMessage { + /** AudioMessage url */ + url?: string | null + + /** AudioMessage mimetype */ + mimetype?: string | null + + /** AudioMessage fileSha256 */ + fileSha256?: Uint8Array | null + + /** AudioMessage fileLength */ + fileLength?: number | Long | null + + /** AudioMessage seconds */ + seconds?: number | null + + /** AudioMessage ptt */ + ptt?: boolean | null + + /** AudioMessage mediaKey */ + mediaKey?: Uint8Array | null + + /** AudioMessage fileEncSha256 */ + fileEncSha256?: Uint8Array | null + + /** AudioMessage directPath */ + directPath?: string | null + + /** AudioMessage mediaKeyTimestamp */ + mediaKeyTimestamp?: number | Long | null + + /** AudioMessage contextInfo */ + contextInfo?: proto.IContextInfo | null + + /** AudioMessage streamingSidecar */ + streamingSidecar?: Uint8Array | null + } + + /** Represents an AudioMessage. */ + class AudioMessage implements IAudioMessage { + /** + * Constructs a new AudioMessage. + * @param [properties] Properties to set + */ + constructor(properties?: proto.IAudioMessage) + + /** AudioMessage url. */ + public url: string + + /** AudioMessage mimetype. */ + public mimetype: string + + /** AudioMessage fileSha256. */ + public fileSha256: Uint8Array + + /** AudioMessage fileLength. */ + public fileLength: number | Long + + /** AudioMessage seconds. */ + public seconds: number + + /** AudioMessage ptt. */ + public ptt: boolean + + /** AudioMessage mediaKey. */ + public mediaKey: Uint8Array + + /** AudioMessage fileEncSha256. */ + public fileEncSha256: Uint8Array + + /** AudioMessage directPath. */ + public directPath: string + + /** AudioMessage mediaKeyTimestamp. */ + public mediaKeyTimestamp: number | Long + + /** AudioMessage contextInfo. */ + public contextInfo?: proto.IContextInfo | null + + /** AudioMessage streamingSidecar. */ + public streamingSidecar: Uint8Array + + /** + * Creates a new AudioMessage instance using the specified properties. + * @param [properties] Properties to set + * @returns AudioMessage instance + */ + public static create(properties?: proto.IAudioMessage): proto.AudioMessage + + /** + * Encodes the specified AudioMessage message. Does not implicitly {@link proto.AudioMessage.verify|verify} messages. + * @param message AudioMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.IAudioMessage, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Encodes the specified AudioMessage message, length delimited. Does not implicitly {@link proto.AudioMessage.verify|verify} messages. + * @param message AudioMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.IAudioMessage, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Decodes an AudioMessage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AudioMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): proto.AudioMessage + + /** + * Decodes an AudioMessage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AudioMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): proto.AudioMessage + + /** + * Verifies an AudioMessage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null + + /** + * Creates an AudioMessage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AudioMessage + */ + public static fromObject(object: { [k: string]: any }): proto.AudioMessage + + /** + * Creates a plain object from an AudioMessage message. Also converts values to other types if specified. + * @param message AudioMessage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: proto.AudioMessage, + options?: $protobuf.IConversionOptions, + ): { [k: string]: any } + + /** + * Converts this AudioMessage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any } + } + + /** Properties of a VideoMessage. */ + interface IVideoMessage { + /** VideoMessage url */ + url?: string | null + + /** VideoMessage mimetype */ + mimetype?: string | null + + /** VideoMessage fileSha256 */ + fileSha256?: Uint8Array | null + + /** VideoMessage fileLength */ + fileLength?: number | Long | null + + /** VideoMessage seconds */ + seconds?: number | null + + /** VideoMessage mediaKey */ + mediaKey?: Uint8Array | null + + /** VideoMessage caption */ + caption?: string | null + + /** VideoMessage gifPlayback */ + gifPlayback?: boolean | null + + /** VideoMessage height */ + height?: number | null + + /** VideoMessage width */ + width?: number | null + + /** VideoMessage fileEncSha256 */ + fileEncSha256?: Uint8Array | null + + /** VideoMessage interactiveAnnotations */ + interactiveAnnotations?: proto.IInteractiveAnnotation[] | null + + /** VideoMessage directPath */ + directPath?: string | null + + /** VideoMessage mediaKeyTimestamp */ + mediaKeyTimestamp?: number | Long | null + + /** VideoMessage jpegThumbnail */ + jpegThumbnail?: Uint8Array | null + + /** VideoMessage contextInfo */ + contextInfo?: proto.IContextInfo | null + + /** VideoMessage streamingSidecar */ + streamingSidecar?: Uint8Array | null + + /** VideoMessage gifAttribution */ + gifAttribution?: proto.VideoMessage.VIDEO_MESSAGE_ATTRIBUTION | null + } + + /** Represents a VideoMessage. */ + class VideoMessage implements IVideoMessage { + /** + * Constructs a new VideoMessage. + * @param [properties] Properties to set + */ + constructor(properties?: proto.IVideoMessage) + + /** VideoMessage url. */ + public url: string + + /** VideoMessage mimetype. */ + public mimetype: string + + /** VideoMessage fileSha256. */ + public fileSha256: Uint8Array + + /** VideoMessage fileLength. */ + public fileLength: number | Long + + /** VideoMessage seconds. */ + public seconds: number + + /** VideoMessage mediaKey. */ + public mediaKey: Uint8Array + + /** VideoMessage caption. */ + public caption: string + + /** VideoMessage gifPlayback. */ + public gifPlayback: boolean + + /** VideoMessage height. */ + public height: number + + /** VideoMessage width. */ + public width: number + + /** VideoMessage fileEncSha256. */ + public fileEncSha256: Uint8Array + + /** VideoMessage interactiveAnnotations. */ + public interactiveAnnotations: proto.IInteractiveAnnotation[] + + /** VideoMessage directPath. */ + public directPath: string + + /** VideoMessage mediaKeyTimestamp. */ + public mediaKeyTimestamp: number | Long + + /** VideoMessage jpegThumbnail. */ + public jpegThumbnail: Uint8Array + + /** VideoMessage contextInfo. */ + public contextInfo?: proto.IContextInfo | null + + /** VideoMessage streamingSidecar. */ + public streamingSidecar: Uint8Array + + /** VideoMessage gifAttribution. */ + public gifAttribution: proto.VideoMessage.VIDEO_MESSAGE_ATTRIBUTION + + /** + * Creates a new VideoMessage instance using the specified properties. + * @param [properties] Properties to set + * @returns VideoMessage instance + */ + public static create(properties?: proto.IVideoMessage): proto.VideoMessage + + /** + * Encodes the specified VideoMessage message. Does not implicitly {@link proto.VideoMessage.verify|verify} messages. + * @param message VideoMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.IVideoMessage, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Encodes the specified VideoMessage message, length delimited. Does not implicitly {@link proto.VideoMessage.verify|verify} messages. + * @param message VideoMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.IVideoMessage, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Decodes a VideoMessage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VideoMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): proto.VideoMessage + + /** + * Decodes a VideoMessage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VideoMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): proto.VideoMessage + + /** + * Verifies a VideoMessage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null + + /** + * Creates a VideoMessage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VideoMessage + */ + public static fromObject(object: { [k: string]: any }): proto.VideoMessage + + /** + * Creates a plain object from a VideoMessage message. Also converts values to other types if specified. + * @param message VideoMessage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: proto.VideoMessage, + options?: $protobuf.IConversionOptions, + ): { [k: string]: any } + + /** + * Converts this VideoMessage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any } + } + + namespace VideoMessage { + /** VIDEO_MESSAGE_ATTRIBUTION enum. */ + enum VIDEO_MESSAGE_ATTRIBUTION { + NONE = 0, + GIPHY = 1, + TENOR = 2, + } + } + + /** Properties of a Call. */ + interface ICall { + /** Call callKey */ + callKey?: Uint8Array | null + } + + /** Represents a Call. */ + class Call implements ICall { + /** + * Constructs a new Call. + * @param [properties] Properties to set + */ + constructor(properties?: proto.ICall) + + /** Call callKey. */ + public callKey: Uint8Array + + /** + * Creates a new Call instance using the specified properties. + * @param [properties] Properties to set + * @returns Call instance + */ + public static create(properties?: proto.ICall): proto.Call + + /** + * Encodes the specified Call message. Does not implicitly {@link proto.Call.verify|verify} messages. + * @param message Call message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.ICall, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Encodes the specified Call message, length delimited. Does not implicitly {@link proto.Call.verify|verify} messages. + * @param message Call message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.ICall, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Decodes a Call message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Call + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): proto.Call + + /** + * Decodes a Call message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Call + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): proto.Call + + /** + * Verifies a Call message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null + + /** + * Creates a Call message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Call + */ + public static fromObject(object: { [k: string]: any }): proto.Call + + /** + * Creates a plain object from a Call message. Also converts values to other types if specified. + * @param message Call + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: proto.Call, options?: $protobuf.IConversionOptions): { [k: string]: any } + + /** + * Converts this Call to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any } + } + + /** Properties of a Chat. */ + interface IChat { + /** Chat displayName */ + displayName?: string | null + + /** Chat id */ + id?: string | null + } + + /** Represents a Chat. */ + class Chat implements IChat { + /** + * Constructs a new Chat. + * @param [properties] Properties to set + */ + constructor(properties?: proto.IChat) + + /** Chat displayName. */ + public displayName: string + + /** Chat id. */ + public id: string + + /** + * Creates a new Chat instance using the specified properties. + * @param [properties] Properties to set + * @returns Chat instance + */ + public static create(properties?: proto.IChat): proto.Chat + + /** + * Encodes the specified Chat message. Does not implicitly {@link proto.Chat.verify|verify} messages. + * @param message Chat message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.IChat, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Encodes the specified Chat message, length delimited. Does not implicitly {@link proto.Chat.verify|verify} messages. + * @param message Chat message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.IChat, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Decodes a Chat message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Chat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): proto.Chat + + /** + * Decodes a Chat message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Chat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): proto.Chat + + /** + * Verifies a Chat message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null + + /** + * Creates a Chat message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Chat + */ + public static fromObject(object: { [k: string]: any }): proto.Chat + + /** + * Creates a plain object from a Chat message. Also converts values to other types if specified. + * @param message Chat + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: proto.Chat, options?: $protobuf.IConversionOptions): { [k: string]: any } + + /** + * Converts this Chat to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any } + } + + /** Properties of a ProtocolMessage. */ + interface IProtocolMessage { + /** ProtocolMessage key */ + key?: proto.IMessageKey | null + + /** ProtocolMessage type */ + type?: proto.ProtocolMessage.PROTOCOL_MESSAGE_TYPE | null + + /** ProtocolMessage ephemeralExpiration */ + ephemeralExpiration?: number | null + } + + /** Represents a ProtocolMessage. */ + class ProtocolMessage implements IProtocolMessage { + /** + * Constructs a new ProtocolMessage. + * @param [properties] Properties to set + */ + constructor(properties?: proto.IProtocolMessage) + + /** ProtocolMessage key. */ + public key?: proto.IMessageKey | null + + /** ProtocolMessage type. */ + public type: proto.ProtocolMessage.PROTOCOL_MESSAGE_TYPE + + /** ProtocolMessage ephemeralExpiration. */ + public ephemeralExpiration: number + + /** + * Creates a new ProtocolMessage instance using the specified properties. + * @param [properties] Properties to set + * @returns ProtocolMessage instance + */ + public static create(properties?: proto.IProtocolMessage): proto.ProtocolMessage + + /** + * Encodes the specified ProtocolMessage message. Does not implicitly {@link proto.ProtocolMessage.verify|verify} messages. + * @param message ProtocolMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.IProtocolMessage, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Encodes the specified ProtocolMessage message, length delimited. Does not implicitly {@link proto.ProtocolMessage.verify|verify} messages. + * @param message ProtocolMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.IProtocolMessage, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Decodes a ProtocolMessage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProtocolMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): proto.ProtocolMessage + + /** + * Decodes a ProtocolMessage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProtocolMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): proto.ProtocolMessage + + /** + * Verifies a ProtocolMessage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null + + /** + * Creates a ProtocolMessage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProtocolMessage + */ + public static fromObject(object: { [k: string]: any }): proto.ProtocolMessage + + /** + * Creates a plain object from a ProtocolMessage message. Also converts values to other types if specified. + * @param message ProtocolMessage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: proto.ProtocolMessage, + options?: $protobuf.IConversionOptions, + ): { [k: string]: any } + + /** + * Converts this ProtocolMessage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any } + } + + namespace ProtocolMessage { + /** PROTOCOL_MESSAGE_TYPE enum. */ + enum PROTOCOL_MESSAGE_TYPE { + REVOKE = 0, + EPHEMERAL_SETTING = 3, + } + } + + /** Properties of a ContactsArrayMessage. */ + interface IContactsArrayMessage { + /** ContactsArrayMessage displayName */ + displayName?: string | null + + /** ContactsArrayMessage contacts */ + contacts?: proto.IContactMessage[] | null + + /** ContactsArrayMessage contextInfo */ + contextInfo?: proto.IContextInfo | null + } + + /** Represents a ContactsArrayMessage. */ + class ContactsArrayMessage implements IContactsArrayMessage { + /** + * Constructs a new ContactsArrayMessage. + * @param [properties] Properties to set + */ + constructor(properties?: proto.IContactsArrayMessage) + + /** ContactsArrayMessage displayName. */ + public displayName: string + + /** ContactsArrayMessage contacts. */ + public contacts: proto.IContactMessage[] + + /** ContactsArrayMessage contextInfo. */ + public contextInfo?: proto.IContextInfo | null + + /** + * Creates a new ContactsArrayMessage instance using the specified properties. + * @param [properties] Properties to set + * @returns ContactsArrayMessage instance + */ + public static create(properties?: proto.IContactsArrayMessage): proto.ContactsArrayMessage + + /** + * Encodes the specified ContactsArrayMessage message. Does not implicitly {@link proto.ContactsArrayMessage.verify|verify} messages. + * @param message ContactsArrayMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.IContactsArrayMessage, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Encodes the specified ContactsArrayMessage message, length delimited. Does not implicitly {@link proto.ContactsArrayMessage.verify|verify} messages. + * @param message ContactsArrayMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.IContactsArrayMessage, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Decodes a ContactsArrayMessage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ContactsArrayMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): proto.ContactsArrayMessage + + /** + * Decodes a ContactsArrayMessage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ContactsArrayMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): proto.ContactsArrayMessage + + /** + * Verifies a ContactsArrayMessage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null + + /** + * Creates a ContactsArrayMessage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ContactsArrayMessage + */ + public static fromObject(object: { [k: string]: any }): proto.ContactsArrayMessage + + /** + * Creates a plain object from a ContactsArrayMessage message. Also converts values to other types if specified. + * @param message ContactsArrayMessage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: proto.ContactsArrayMessage, + options?: $protobuf.IConversionOptions, + ): { [k: string]: any } + + /** + * Converts this ContactsArrayMessage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any } + } + + /** Properties of a HSMCurrency. */ + interface IHSMCurrency { + /** HSMCurrency currencyCode */ + currencyCode?: string | null + + /** HSMCurrency amount1000 */ + amount1000?: number | Long | null + } + + /** Represents a HSMCurrency. */ + class HSMCurrency implements IHSMCurrency { + /** + * Constructs a new HSMCurrency. + * @param [properties] Properties to set + */ + constructor(properties?: proto.IHSMCurrency) + + /** HSMCurrency currencyCode. */ + public currencyCode: string + + /** HSMCurrency amount1000. */ + public amount1000: number | Long + + /** + * Creates a new HSMCurrency instance using the specified properties. + * @param [properties] Properties to set + * @returns HSMCurrency instance + */ + public static create(properties?: proto.IHSMCurrency): proto.HSMCurrency + + /** + * Encodes the specified HSMCurrency message. Does not implicitly {@link proto.HSMCurrency.verify|verify} messages. + * @param message HSMCurrency message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.IHSMCurrency, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Encodes the specified HSMCurrency message, length delimited. Does not implicitly {@link proto.HSMCurrency.verify|verify} messages. + * @param message HSMCurrency message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.IHSMCurrency, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Decodes a HSMCurrency message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HSMCurrency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): proto.HSMCurrency + + /** + * Decodes a HSMCurrency message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HSMCurrency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): proto.HSMCurrency + + /** + * Verifies a HSMCurrency message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null + + /** + * Creates a HSMCurrency message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HSMCurrency + */ + public static fromObject(object: { [k: string]: any }): proto.HSMCurrency + + /** + * Creates a plain object from a HSMCurrency message. Also converts values to other types if specified. + * @param message HSMCurrency + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: proto.HSMCurrency, options?: $protobuf.IConversionOptions): { [k: string]: any } + + /** + * Converts this HSMCurrency to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any } + } + + /** Properties of a HSMDateTimeComponent. */ + interface IHSMDateTimeComponent { + /** HSMDateTimeComponent dayOfWeek */ + dayOfWeek?: proto.HSMDateTimeComponent.HSM_DATE_TIME_COMPONENT_DAYOFWEEKTYPE | null + + /** HSMDateTimeComponent year */ + year?: number | null + + /** HSMDateTimeComponent month */ + month?: number | null + + /** HSMDateTimeComponent dayOfMonth */ + dayOfMonth?: number | null + + /** HSMDateTimeComponent hour */ + hour?: number | null + + /** HSMDateTimeComponent minute */ + minute?: number | null + + /** HSMDateTimeComponent calendar */ + calendar?: proto.HSMDateTimeComponent.HSM_DATE_TIME_COMPONENT_CALENDARTYPE | null + } + + /** Represents a HSMDateTimeComponent. */ + class HSMDateTimeComponent implements IHSMDateTimeComponent { + /** + * Constructs a new HSMDateTimeComponent. + * @param [properties] Properties to set + */ + constructor(properties?: proto.IHSMDateTimeComponent) + + /** HSMDateTimeComponent dayOfWeek. */ + public dayOfWeek: proto.HSMDateTimeComponent.HSM_DATE_TIME_COMPONENT_DAYOFWEEKTYPE + + /** HSMDateTimeComponent year. */ + public year: number + + /** HSMDateTimeComponent month. */ + public month: number + + /** HSMDateTimeComponent dayOfMonth. */ + public dayOfMonth: number + + /** HSMDateTimeComponent hour. */ + public hour: number + + /** HSMDateTimeComponent minute. */ + public minute: number + + /** HSMDateTimeComponent calendar. */ + public calendar: proto.HSMDateTimeComponent.HSM_DATE_TIME_COMPONENT_CALENDARTYPE + + /** + * Creates a new HSMDateTimeComponent instance using the specified properties. + * @param [properties] Properties to set + * @returns HSMDateTimeComponent instance + */ + public static create(properties?: proto.IHSMDateTimeComponent): proto.HSMDateTimeComponent + + /** + * Encodes the specified HSMDateTimeComponent message. Does not implicitly {@link proto.HSMDateTimeComponent.verify|verify} messages. + * @param message HSMDateTimeComponent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.IHSMDateTimeComponent, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Encodes the specified HSMDateTimeComponent message, length delimited. Does not implicitly {@link proto.HSMDateTimeComponent.verify|verify} messages. + * @param message HSMDateTimeComponent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.IHSMDateTimeComponent, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Decodes a HSMDateTimeComponent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HSMDateTimeComponent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): proto.HSMDateTimeComponent + + /** + * Decodes a HSMDateTimeComponent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HSMDateTimeComponent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): proto.HSMDateTimeComponent + + /** + * Verifies a HSMDateTimeComponent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null + + /** + * Creates a HSMDateTimeComponent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HSMDateTimeComponent + */ + public static fromObject(object: { [k: string]: any }): proto.HSMDateTimeComponent + + /** + * Creates a plain object from a HSMDateTimeComponent message. Also converts values to other types if specified. + * @param message HSMDateTimeComponent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: proto.HSMDateTimeComponent, + options?: $protobuf.IConversionOptions, + ): { [k: string]: any } + + /** + * Converts this HSMDateTimeComponent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any } + } + + namespace HSMDateTimeComponent { + /** HSM_DATE_TIME_COMPONENT_DAYOFWEEKTYPE enum. */ + enum HSM_DATE_TIME_COMPONENT_DAYOFWEEKTYPE { + MONDAY = 1, + TUESDAY = 2, + WEDNESDAY = 3, + THURSDAY = 4, + FRIDAY = 5, + SATURDAY = 6, + SUNDAY = 7, + } + + /** HSM_DATE_TIME_COMPONENT_CALENDARTYPE enum. */ + enum HSM_DATE_TIME_COMPONENT_CALENDARTYPE { + GREGORIAN = 1, + SOLAR_HIJRI = 2, + } + } + + /** Properties of a HSMDateTimeUnixEpoch. */ + interface IHSMDateTimeUnixEpoch { + /** HSMDateTimeUnixEpoch timestamp */ + timestamp?: number | Long | null + } + + /** Represents a HSMDateTimeUnixEpoch. */ + class HSMDateTimeUnixEpoch implements IHSMDateTimeUnixEpoch { + /** + * Constructs a new HSMDateTimeUnixEpoch. + * @param [properties] Properties to set + */ + constructor(properties?: proto.IHSMDateTimeUnixEpoch) + + /** HSMDateTimeUnixEpoch timestamp. */ + public timestamp: number | Long + + /** + * Creates a new HSMDateTimeUnixEpoch instance using the specified properties. + * @param [properties] Properties to set + * @returns HSMDateTimeUnixEpoch instance + */ + public static create(properties?: proto.IHSMDateTimeUnixEpoch): proto.HSMDateTimeUnixEpoch + + /** + * Encodes the specified HSMDateTimeUnixEpoch message. Does not implicitly {@link proto.HSMDateTimeUnixEpoch.verify|verify} messages. + * @param message HSMDateTimeUnixEpoch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.IHSMDateTimeUnixEpoch, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Encodes the specified HSMDateTimeUnixEpoch message, length delimited. Does not implicitly {@link proto.HSMDateTimeUnixEpoch.verify|verify} messages. + * @param message HSMDateTimeUnixEpoch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.IHSMDateTimeUnixEpoch, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Decodes a HSMDateTimeUnixEpoch message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HSMDateTimeUnixEpoch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): proto.HSMDateTimeUnixEpoch + + /** + * Decodes a HSMDateTimeUnixEpoch message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HSMDateTimeUnixEpoch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): proto.HSMDateTimeUnixEpoch + + /** + * Verifies a HSMDateTimeUnixEpoch message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null + + /** + * Creates a HSMDateTimeUnixEpoch message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HSMDateTimeUnixEpoch + */ + public static fromObject(object: { [k: string]: any }): proto.HSMDateTimeUnixEpoch + + /** + * Creates a plain object from a HSMDateTimeUnixEpoch message. Also converts values to other types if specified. + * @param message HSMDateTimeUnixEpoch + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: proto.HSMDateTimeUnixEpoch, + options?: $protobuf.IConversionOptions, + ): { [k: string]: any } + + /** + * Converts this HSMDateTimeUnixEpoch to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any } + } + + /** Properties of a HSMDateTime. */ + interface IHSMDateTime { + /** HSMDateTime component */ + component?: proto.IHSMDateTimeComponent | null + + /** HSMDateTime unixEpoch */ + unixEpoch?: proto.IHSMDateTimeUnixEpoch | null + } + + /** Represents a HSMDateTime. */ + class HSMDateTime implements IHSMDateTime { + /** + * Constructs a new HSMDateTime. + * @param [properties] Properties to set + */ + constructor(properties?: proto.IHSMDateTime) + + /** HSMDateTime component. */ + public component?: proto.IHSMDateTimeComponent | null + + /** HSMDateTime unixEpoch. */ + public unixEpoch?: proto.IHSMDateTimeUnixEpoch | null + + /** HSMDateTime datetimeOneof. */ + public datetimeOneof?: 'component' | 'unixEpoch' + + /** + * Creates a new HSMDateTime instance using the specified properties. + * @param [properties] Properties to set + * @returns HSMDateTime instance + */ + public static create(properties?: proto.IHSMDateTime): proto.HSMDateTime + + /** + * Encodes the specified HSMDateTime message. Does not implicitly {@link proto.HSMDateTime.verify|verify} messages. + * @param message HSMDateTime message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.IHSMDateTime, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Encodes the specified HSMDateTime message, length delimited. Does not implicitly {@link proto.HSMDateTime.verify|verify} messages. + * @param message HSMDateTime message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.IHSMDateTime, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Decodes a HSMDateTime message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HSMDateTime + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): proto.HSMDateTime + + /** + * Decodes a HSMDateTime message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HSMDateTime + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): proto.HSMDateTime + + /** + * Verifies a HSMDateTime message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null + + /** + * Creates a HSMDateTime message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HSMDateTime + */ + public static fromObject(object: { [k: string]: any }): proto.HSMDateTime + + /** + * Creates a plain object from a HSMDateTime message. Also converts values to other types if specified. + * @param message HSMDateTime + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: proto.HSMDateTime, options?: $protobuf.IConversionOptions): { [k: string]: any } + + /** + * Converts this HSMDateTime to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any } + } + + /** Properties of a HSMLocalizableParameter. */ + interface IHSMLocalizableParameter { + /** HSMLocalizableParameter default */ + default?: string | null + + /** HSMLocalizableParameter currency */ + currency?: proto.IHSMCurrency | null + + /** HSMLocalizableParameter dateTime */ + dateTime?: proto.IHSMDateTime | null + } + + /** Represents a HSMLocalizableParameter. */ + class HSMLocalizableParameter implements IHSMLocalizableParameter { + /** + * Constructs a new HSMLocalizableParameter. + * @param [properties] Properties to set + */ + constructor(properties?: proto.IHSMLocalizableParameter) + + /** HSMLocalizableParameter default. */ + public default: string + + /** HSMLocalizableParameter currency. */ + public currency?: proto.IHSMCurrency | null + + /** HSMLocalizableParameter dateTime. */ + public dateTime?: proto.IHSMDateTime | null + + /** HSMLocalizableParameter paramOneof. */ + public paramOneof?: 'currency' | 'dateTime' + + /** + * Creates a new HSMLocalizableParameter instance using the specified properties. + * @param [properties] Properties to set + * @returns HSMLocalizableParameter instance + */ + public static create(properties?: proto.IHSMLocalizableParameter): proto.HSMLocalizableParameter + + /** + * Encodes the specified HSMLocalizableParameter message. Does not implicitly {@link proto.HSMLocalizableParameter.verify|verify} messages. + * @param message HSMLocalizableParameter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.IHSMLocalizableParameter, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Encodes the specified HSMLocalizableParameter message, length delimited. Does not implicitly {@link proto.HSMLocalizableParameter.verify|verify} messages. + * @param message HSMLocalizableParameter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: proto.IHSMLocalizableParameter, + writer?: $protobuf.Writer, + ): $protobuf.Writer + + /** + * Decodes a HSMLocalizableParameter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HSMLocalizableParameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): proto.HSMLocalizableParameter + + /** + * Decodes a HSMLocalizableParameter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HSMLocalizableParameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): proto.HSMLocalizableParameter + + /** + * Verifies a HSMLocalizableParameter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null + + /** + * Creates a HSMLocalizableParameter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HSMLocalizableParameter + */ + public static fromObject(object: { [k: string]: any }): proto.HSMLocalizableParameter + + /** + * Creates a plain object from a HSMLocalizableParameter message. Also converts values to other types if specified. + * @param message HSMLocalizableParameter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: proto.HSMLocalizableParameter, + options?: $protobuf.IConversionOptions, + ): { [k: string]: any } + + /** + * Converts this HSMLocalizableParameter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any } + } + + /** Properties of a HighlyStructuredMessage. */ + interface IHighlyStructuredMessage { + /** HighlyStructuredMessage namespace */ + namespace?: string | null + + /** HighlyStructuredMessage elementName */ + elementName?: string | null + + /** HighlyStructuredMessage params */ + params?: string[] | null + + /** HighlyStructuredMessage fallbackLg */ + fallbackLg?: string | null + + /** HighlyStructuredMessage fallbackLc */ + fallbackLc?: string | null + + /** HighlyStructuredMessage localizableParams */ + localizableParams?: proto.IHSMLocalizableParameter[] | null + + /** HighlyStructuredMessage deterministicLg */ + deterministicLg?: string | null + + /** HighlyStructuredMessage deterministicLc */ + deterministicLc?: string | null + + /** HighlyStructuredMessage hydratedHsm */ + hydratedHsm?: proto.ITemplateMessage | null + } + + /** Represents a HighlyStructuredMessage. */ + class HighlyStructuredMessage implements IHighlyStructuredMessage { + /** + * Constructs a new HighlyStructuredMessage. + * @param [properties] Properties to set + */ + constructor(properties?: proto.IHighlyStructuredMessage) + + /** HighlyStructuredMessage namespace. */ + public namespace: string + + /** HighlyStructuredMessage elementName. */ + public elementName: string + + /** HighlyStructuredMessage params. */ + public params: string[] + + /** HighlyStructuredMessage fallbackLg. */ + public fallbackLg: string + + /** HighlyStructuredMessage fallbackLc. */ + public fallbackLc: string + + /** HighlyStructuredMessage localizableParams. */ + public localizableParams: proto.IHSMLocalizableParameter[] + + /** HighlyStructuredMessage deterministicLg. */ + public deterministicLg: string + + /** HighlyStructuredMessage deterministicLc. */ + public deterministicLc: string + + /** HighlyStructuredMessage hydratedHsm. */ + public hydratedHsm?: proto.ITemplateMessage | null + + /** + * Creates a new HighlyStructuredMessage instance using the specified properties. + * @param [properties] Properties to set + * @returns HighlyStructuredMessage instance + */ + public static create(properties?: proto.IHighlyStructuredMessage): proto.HighlyStructuredMessage + + /** + * Encodes the specified HighlyStructuredMessage message. Does not implicitly {@link proto.HighlyStructuredMessage.verify|verify} messages. + * @param message HighlyStructuredMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.IHighlyStructuredMessage, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Encodes the specified HighlyStructuredMessage message, length delimited. Does not implicitly {@link proto.HighlyStructuredMessage.verify|verify} messages. + * @param message HighlyStructuredMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: proto.IHighlyStructuredMessage, + writer?: $protobuf.Writer, + ): $protobuf.Writer + + /** + * Decodes a HighlyStructuredMessage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HighlyStructuredMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): proto.HighlyStructuredMessage + + /** + * Decodes a HighlyStructuredMessage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HighlyStructuredMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): proto.HighlyStructuredMessage + + /** + * Verifies a HighlyStructuredMessage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null + + /** + * Creates a HighlyStructuredMessage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HighlyStructuredMessage + */ + public static fromObject(object: { [k: string]: any }): proto.HighlyStructuredMessage + + /** + * Creates a plain object from a HighlyStructuredMessage message. Also converts values to other types if specified. + * @param message HighlyStructuredMessage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: proto.HighlyStructuredMessage, + options?: $protobuf.IConversionOptions, + ): { [k: string]: any } + + /** + * Converts this HighlyStructuredMessage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any } + } + + /** Properties of a SendPaymentMessage. */ + interface ISendPaymentMessage { + /** SendPaymentMessage noteMessage */ + noteMessage?: proto.IMessage | null + + /** SendPaymentMessage requestMessageKey */ + requestMessageKey?: proto.IMessageKey | null + } + + /** Represents a SendPaymentMessage. */ + class SendPaymentMessage implements ISendPaymentMessage { + /** + * Constructs a new SendPaymentMessage. + * @param [properties] Properties to set + */ + constructor(properties?: proto.ISendPaymentMessage) + + /** SendPaymentMessage noteMessage. */ + public noteMessage?: proto.IMessage | null + + /** SendPaymentMessage requestMessageKey. */ + public requestMessageKey?: proto.IMessageKey | null + + /** + * Creates a new SendPaymentMessage instance using the specified properties. + * @param [properties] Properties to set + * @returns SendPaymentMessage instance + */ + public static create(properties?: proto.ISendPaymentMessage): proto.SendPaymentMessage + + /** + * Encodes the specified SendPaymentMessage message. Does not implicitly {@link proto.SendPaymentMessage.verify|verify} messages. + * @param message SendPaymentMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.ISendPaymentMessage, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Encodes the specified SendPaymentMessage message, length delimited. Does not implicitly {@link proto.SendPaymentMessage.verify|verify} messages. + * @param message SendPaymentMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.ISendPaymentMessage, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Decodes a SendPaymentMessage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SendPaymentMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): proto.SendPaymentMessage + + /** + * Decodes a SendPaymentMessage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SendPaymentMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): proto.SendPaymentMessage + + /** + * Verifies a SendPaymentMessage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null + + /** + * Creates a SendPaymentMessage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SendPaymentMessage + */ + public static fromObject(object: { [k: string]: any }): proto.SendPaymentMessage + + /** + * Creates a plain object from a SendPaymentMessage message. Also converts values to other types if specified. + * @param message SendPaymentMessage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: proto.SendPaymentMessage, + options?: $protobuf.IConversionOptions, + ): { [k: string]: any } + + /** + * Converts this SendPaymentMessage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any } + } + + /** Properties of a RequestPaymentMessage. */ + interface IRequestPaymentMessage { + /** RequestPaymentMessage noteMessage */ + noteMessage?: proto.IMessage | null + + /** RequestPaymentMessage currencyCodeIso4217 */ + currencyCodeIso4217?: string | null + + /** RequestPaymentMessage amount1000 */ + amount1000?: number | Long | null + + /** RequestPaymentMessage requestFrom */ + requestFrom?: string | null + + /** RequestPaymentMessage expiryTimestamp */ + expiryTimestamp?: number | Long | null + } + + /** Represents a RequestPaymentMessage. */ + class RequestPaymentMessage implements IRequestPaymentMessage { + /** + * Constructs a new RequestPaymentMessage. + * @param [properties] Properties to set + */ + constructor(properties?: proto.IRequestPaymentMessage) + + /** RequestPaymentMessage noteMessage. */ + public noteMessage?: proto.IMessage | null + + /** RequestPaymentMessage currencyCodeIso4217. */ + public currencyCodeIso4217: string + + /** RequestPaymentMessage amount1000. */ + public amount1000: number | Long + + /** RequestPaymentMessage requestFrom. */ + public requestFrom: string + + /** RequestPaymentMessage expiryTimestamp. */ + public expiryTimestamp: number | Long + + /** + * Creates a new RequestPaymentMessage instance using the specified properties. + * @param [properties] Properties to set + * @returns RequestPaymentMessage instance + */ + public static create(properties?: proto.IRequestPaymentMessage): proto.RequestPaymentMessage + + /** + * Encodes the specified RequestPaymentMessage message. Does not implicitly {@link proto.RequestPaymentMessage.verify|verify} messages. + * @param message RequestPaymentMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.IRequestPaymentMessage, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Encodes the specified RequestPaymentMessage message, length delimited. Does not implicitly {@link proto.RequestPaymentMessage.verify|verify} messages. + * @param message RequestPaymentMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: proto.IRequestPaymentMessage, + writer?: $protobuf.Writer, + ): $protobuf.Writer + + /** + * Decodes a RequestPaymentMessage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RequestPaymentMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): proto.RequestPaymentMessage + + /** + * Decodes a RequestPaymentMessage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RequestPaymentMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): proto.RequestPaymentMessage + + /** + * Verifies a RequestPaymentMessage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null + + /** + * Creates a RequestPaymentMessage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RequestPaymentMessage + */ + public static fromObject(object: { [k: string]: any }): proto.RequestPaymentMessage + + /** + * Creates a plain object from a RequestPaymentMessage message. Also converts values to other types if specified. + * @param message RequestPaymentMessage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: proto.RequestPaymentMessage, + options?: $protobuf.IConversionOptions, + ): { [k: string]: any } + + /** + * Converts this RequestPaymentMessage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any } + } + + /** Properties of a DeclinePaymentRequestMessage. */ + interface IDeclinePaymentRequestMessage { + /** DeclinePaymentRequestMessage key */ + key?: proto.IMessageKey | null + } + + /** Represents a DeclinePaymentRequestMessage. */ + class DeclinePaymentRequestMessage implements IDeclinePaymentRequestMessage { + /** + * Constructs a new DeclinePaymentRequestMessage. + * @param [properties] Properties to set + */ + constructor(properties?: proto.IDeclinePaymentRequestMessage) + + /** DeclinePaymentRequestMessage key. */ + public key?: proto.IMessageKey | null + + /** + * Creates a new DeclinePaymentRequestMessage instance using the specified properties. + * @param [properties] Properties to set + * @returns DeclinePaymentRequestMessage instance + */ + public static create(properties?: proto.IDeclinePaymentRequestMessage): proto.DeclinePaymentRequestMessage + + /** + * Encodes the specified DeclinePaymentRequestMessage message. Does not implicitly {@link proto.DeclinePaymentRequestMessage.verify|verify} messages. + * @param message DeclinePaymentRequestMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.IDeclinePaymentRequestMessage, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Encodes the specified DeclinePaymentRequestMessage message, length delimited. Does not implicitly {@link proto.DeclinePaymentRequestMessage.verify|verify} messages. + * @param message DeclinePaymentRequestMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: proto.IDeclinePaymentRequestMessage, + writer?: $protobuf.Writer, + ): $protobuf.Writer + + /** + * Decodes a DeclinePaymentRequestMessage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeclinePaymentRequestMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): proto.DeclinePaymentRequestMessage + + /** + * Decodes a DeclinePaymentRequestMessage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeclinePaymentRequestMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): proto.DeclinePaymentRequestMessage + + /** + * Verifies a DeclinePaymentRequestMessage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null + + /** + * Creates a DeclinePaymentRequestMessage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeclinePaymentRequestMessage + */ + public static fromObject(object: { [k: string]: any }): proto.DeclinePaymentRequestMessage + + /** + * Creates a plain object from a DeclinePaymentRequestMessage message. Also converts values to other types if specified. + * @param message DeclinePaymentRequestMessage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: proto.DeclinePaymentRequestMessage, + options?: $protobuf.IConversionOptions, + ): { [k: string]: any } + + /** + * Converts this DeclinePaymentRequestMessage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any } + } + + /** Properties of a CancelPaymentRequestMessage. */ + interface ICancelPaymentRequestMessage { + /** CancelPaymentRequestMessage key */ + key?: proto.IMessageKey | null + } + + /** Represents a CancelPaymentRequestMessage. */ + class CancelPaymentRequestMessage implements ICancelPaymentRequestMessage { + /** + * Constructs a new CancelPaymentRequestMessage. + * @param [properties] Properties to set + */ + constructor(properties?: proto.ICancelPaymentRequestMessage) + + /** CancelPaymentRequestMessage key. */ + public key?: proto.IMessageKey | null + + /** + * Creates a new CancelPaymentRequestMessage instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelPaymentRequestMessage instance + */ + public static create(properties?: proto.ICancelPaymentRequestMessage): proto.CancelPaymentRequestMessage + + /** + * Encodes the specified CancelPaymentRequestMessage message. Does not implicitly {@link proto.CancelPaymentRequestMessage.verify|verify} messages. + * @param message CancelPaymentRequestMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.ICancelPaymentRequestMessage, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Encodes the specified CancelPaymentRequestMessage message, length delimited. Does not implicitly {@link proto.CancelPaymentRequestMessage.verify|verify} messages. + * @param message CancelPaymentRequestMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: proto.ICancelPaymentRequestMessage, + writer?: $protobuf.Writer, + ): $protobuf.Writer + + /** + * Decodes a CancelPaymentRequestMessage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelPaymentRequestMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): proto.CancelPaymentRequestMessage + + /** + * Decodes a CancelPaymentRequestMessage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelPaymentRequestMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): proto.CancelPaymentRequestMessage + + /** + * Verifies a CancelPaymentRequestMessage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null + + /** + * Creates a CancelPaymentRequestMessage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelPaymentRequestMessage + */ + public static fromObject(object: { [k: string]: any }): proto.CancelPaymentRequestMessage + + /** + * Creates a plain object from a CancelPaymentRequestMessage message. Also converts values to other types if specified. + * @param message CancelPaymentRequestMessage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: proto.CancelPaymentRequestMessage, + options?: $protobuf.IConversionOptions, + ): { [k: string]: any } + + /** + * Converts this CancelPaymentRequestMessage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any } + } + + /** Properties of a LiveLocationMessage. */ + interface ILiveLocationMessage { + /** LiveLocationMessage degreesLatitude */ + degreesLatitude?: number | null + + /** LiveLocationMessage degreesLongitude */ + degreesLongitude?: number | null + + /** LiveLocationMessage accuracyInMeters */ + accuracyInMeters?: number | null + + /** LiveLocationMessage speedInMps */ + speedInMps?: number | null + + /** LiveLocationMessage degreesClockwiseFromMagneticNorth */ + degreesClockwiseFromMagneticNorth?: number | null + + /** LiveLocationMessage caption */ + caption?: string | null + + /** LiveLocationMessage sequenceNumber */ + sequenceNumber?: number | Long | null + + /** LiveLocationMessage timeOffset */ + timeOffset?: number | null + + /** LiveLocationMessage jpegThumbnail */ + jpegThumbnail?: Uint8Array | null + + /** LiveLocationMessage contextInfo */ + contextInfo?: proto.IContextInfo | null + } + + /** Represents a LiveLocationMessage. */ + class LiveLocationMessage implements ILiveLocationMessage { + /** + * Constructs a new LiveLocationMessage. + * @param [properties] Properties to set + */ + constructor(properties?: proto.ILiveLocationMessage) + + /** LiveLocationMessage degreesLatitude. */ + public degreesLatitude: number + + /** LiveLocationMessage degreesLongitude. */ + public degreesLongitude: number + + /** LiveLocationMessage accuracyInMeters. */ + public accuracyInMeters: number + + /** LiveLocationMessage speedInMps. */ + public speedInMps: number + + /** LiveLocationMessage degreesClockwiseFromMagneticNorth. */ + public degreesClockwiseFromMagneticNorth: number + + /** LiveLocationMessage caption. */ + public caption: string + + /** LiveLocationMessage sequenceNumber. */ + public sequenceNumber: number | Long + + /** LiveLocationMessage timeOffset. */ + public timeOffset: number + + /** LiveLocationMessage jpegThumbnail. */ + public jpegThumbnail: Uint8Array + + /** LiveLocationMessage contextInfo. */ + public contextInfo?: proto.IContextInfo | null + + /** + * Creates a new LiveLocationMessage instance using the specified properties. + * @param [properties] Properties to set + * @returns LiveLocationMessage instance + */ + public static create(properties?: proto.ILiveLocationMessage): proto.LiveLocationMessage + + /** + * Encodes the specified LiveLocationMessage message. Does not implicitly {@link proto.LiveLocationMessage.verify|verify} messages. + * @param message LiveLocationMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.ILiveLocationMessage, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Encodes the specified LiveLocationMessage message, length delimited. Does not implicitly {@link proto.LiveLocationMessage.verify|verify} messages. + * @param message LiveLocationMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.ILiveLocationMessage, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Decodes a LiveLocationMessage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LiveLocationMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): proto.LiveLocationMessage + + /** + * Decodes a LiveLocationMessage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LiveLocationMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): proto.LiveLocationMessage + + /** + * Verifies a LiveLocationMessage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null + + /** + * Creates a LiveLocationMessage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LiveLocationMessage + */ + public static fromObject(object: { [k: string]: any }): proto.LiveLocationMessage + + /** + * Creates a plain object from a LiveLocationMessage message. Also converts values to other types if specified. + * @param message LiveLocationMessage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: proto.LiveLocationMessage, + options?: $protobuf.IConversionOptions, + ): { [k: string]: any } + + /** + * Converts this LiveLocationMessage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any } + } + + /** Properties of a StickerMessage. */ + interface IStickerMessage { + /** StickerMessage url */ + url?: string | null + + /** StickerMessage fileSha256 */ + fileSha256?: Uint8Array | null + + /** StickerMessage fileEncSha256 */ + fileEncSha256?: Uint8Array | null + + /** StickerMessage mediaKey */ + mediaKey?: Uint8Array | null + + /** StickerMessage mimetype */ + mimetype?: string | null + + /** StickerMessage height */ + height?: number | null + + /** StickerMessage width */ + width?: number | null + + /** StickerMessage directPath */ + directPath?: string | null + + /** StickerMessage fileLength */ + fileLength?: number | Long | null + + /** StickerMessage mediaKeyTimestamp */ + mediaKeyTimestamp?: number | Long | null + + /** StickerMessage firstFrameLength */ + firstFrameLength?: number | null + + /** StickerMessage firstFrameSidecar */ + firstFrameSidecar?: Uint8Array | null + + /** StickerMessage contextInfo */ + contextInfo?: proto.IContextInfo | null + } + + /** Represents a StickerMessage. */ + class StickerMessage implements IStickerMessage { + /** + * Constructs a new StickerMessage. + * @param [properties] Properties to set + */ + constructor(properties?: proto.IStickerMessage) + + /** StickerMessage url. */ + public url: string + + /** StickerMessage fileSha256. */ + public fileSha256: Uint8Array + + /** StickerMessage fileEncSha256. */ + public fileEncSha256: Uint8Array + + /** StickerMessage mediaKey. */ + public mediaKey: Uint8Array + + /** StickerMessage mimetype. */ + public mimetype: string + + /** StickerMessage height. */ + public height: number + + /** StickerMessage width. */ + public width: number + + /** StickerMessage directPath. */ + public directPath: string + + /** StickerMessage fileLength. */ + public fileLength: number | Long + + /** StickerMessage mediaKeyTimestamp. */ + public mediaKeyTimestamp: number | Long + + /** StickerMessage firstFrameLength. */ + public firstFrameLength: number + + /** StickerMessage firstFrameSidecar. */ + public firstFrameSidecar: Uint8Array + + /** StickerMessage contextInfo. */ + public contextInfo?: proto.IContextInfo | null + + /** + * Creates a new StickerMessage instance using the specified properties. + * @param [properties] Properties to set + * @returns StickerMessage instance + */ + public static create(properties?: proto.IStickerMessage): proto.StickerMessage + + /** + * Encodes the specified StickerMessage message. Does not implicitly {@link proto.StickerMessage.verify|verify} messages. + * @param message StickerMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.IStickerMessage, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Encodes the specified StickerMessage message, length delimited. Does not implicitly {@link proto.StickerMessage.verify|verify} messages. + * @param message StickerMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.IStickerMessage, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Decodes a StickerMessage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StickerMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): proto.StickerMessage + + /** + * Decodes a StickerMessage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StickerMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): proto.StickerMessage + + /** + * Verifies a StickerMessage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null + + /** + * Creates a StickerMessage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StickerMessage + */ + public static fromObject(object: { [k: string]: any }): proto.StickerMessage + + /** + * Creates a plain object from a StickerMessage message. Also converts values to other types if specified. + * @param message StickerMessage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: proto.StickerMessage, + options?: $protobuf.IConversionOptions, + ): { [k: string]: any } + + /** + * Converts this StickerMessage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any } + } + + /** Properties of a FourRowTemplate. */ + interface IFourRowTemplate { + /** FourRowTemplate content */ + content?: proto.IHighlyStructuredMessage | null + + /** FourRowTemplate footer */ + footer?: proto.IHighlyStructuredMessage | null + + /** FourRowTemplate buttons */ + buttons?: proto.ITemplateButton[] | null + + /** FourRowTemplate documentMessage */ + documentMessage?: proto.IDocumentMessage | null + + /** FourRowTemplate highlyStructuredMessage */ + highlyStructuredMessage?: proto.IHighlyStructuredMessage | null + + /** FourRowTemplate imageMessage */ + imageMessage?: proto.IImageMessage | null + + /** FourRowTemplate videoMessage */ + videoMessage?: proto.IVideoMessage | null + + /** FourRowTemplate locationMessage */ + locationMessage?: proto.ILocationMessage | null + } + + /** Represents a FourRowTemplate. */ + class FourRowTemplate implements IFourRowTemplate { + /** + * Constructs a new FourRowTemplate. + * @param [properties] Properties to set + */ + constructor(properties?: proto.IFourRowTemplate) + + /** FourRowTemplate content. */ + public content?: proto.IHighlyStructuredMessage | null + + /** FourRowTemplate footer. */ + public footer?: proto.IHighlyStructuredMessage | null + + /** FourRowTemplate buttons. */ + public buttons: proto.ITemplateButton[] + + /** FourRowTemplate documentMessage. */ + public documentMessage?: proto.IDocumentMessage | null + + /** FourRowTemplate highlyStructuredMessage. */ + public highlyStructuredMessage?: proto.IHighlyStructuredMessage | null + + /** FourRowTemplate imageMessage. */ + public imageMessage?: proto.IImageMessage | null + + /** FourRowTemplate videoMessage. */ + public videoMessage?: proto.IVideoMessage | null + + /** FourRowTemplate locationMessage. */ + public locationMessage?: proto.ILocationMessage | null + + /** FourRowTemplate title. */ + public title?: + | 'documentMessage' + | 'highlyStructuredMessage' + | 'imageMessage' + | 'videoMessage' + | 'locationMessage' + + /** + * Creates a new FourRowTemplate instance using the specified properties. + * @param [properties] Properties to set + * @returns FourRowTemplate instance + */ + public static create(properties?: proto.IFourRowTemplate): proto.FourRowTemplate + + /** + * Encodes the specified FourRowTemplate message. Does not implicitly {@link proto.FourRowTemplate.verify|verify} messages. + * @param message FourRowTemplate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.IFourRowTemplate, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Encodes the specified FourRowTemplate message, length delimited. Does not implicitly {@link proto.FourRowTemplate.verify|verify} messages. + * @param message FourRowTemplate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.IFourRowTemplate, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Decodes a FourRowTemplate message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FourRowTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): proto.FourRowTemplate + + /** + * Decodes a FourRowTemplate message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FourRowTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): proto.FourRowTemplate + + /** + * Verifies a FourRowTemplate message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null + + /** + * Creates a FourRowTemplate message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FourRowTemplate + */ + public static fromObject(object: { [k: string]: any }): proto.FourRowTemplate + + /** + * Creates a plain object from a FourRowTemplate message. Also converts values to other types if specified. + * @param message FourRowTemplate + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: proto.FourRowTemplate, + options?: $protobuf.IConversionOptions, + ): { [k: string]: any } + + /** + * Converts this FourRowTemplate to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any } + } + + /** Properties of a HydratedFourRowTemplate. */ + interface IHydratedFourRowTemplate { + /** HydratedFourRowTemplate hydratedContentText */ + hydratedContentText?: string | null + + /** HydratedFourRowTemplate hydratedFooterText */ + hydratedFooterText?: string | null + + /** HydratedFourRowTemplate hydratedButtons */ + hydratedButtons?: proto.IHydratedTemplateButton[] | null + + /** HydratedFourRowTemplate templateId */ + templateId?: string | null + + /** HydratedFourRowTemplate documentMessage */ + documentMessage?: proto.IDocumentMessage | null + + /** HydratedFourRowTemplate hydratedTitleText */ + hydratedTitleText?: string | null + + /** HydratedFourRowTemplate imageMessage */ + imageMessage?: proto.IImageMessage | null + + /** HydratedFourRowTemplate videoMessage */ + videoMessage?: proto.IVideoMessage | null + + /** HydratedFourRowTemplate locationMessage */ + locationMessage?: proto.ILocationMessage | null + } + + /** Represents a HydratedFourRowTemplate. */ + class HydratedFourRowTemplate implements IHydratedFourRowTemplate { + /** + * Constructs a new HydratedFourRowTemplate. + * @param [properties] Properties to set + */ + constructor(properties?: proto.IHydratedFourRowTemplate) + + /** HydratedFourRowTemplate hydratedContentText. */ + public hydratedContentText: string + + /** HydratedFourRowTemplate hydratedFooterText. */ + public hydratedFooterText: string + + /** HydratedFourRowTemplate hydratedButtons. */ + public hydratedButtons: proto.IHydratedTemplateButton[] + + /** HydratedFourRowTemplate templateId. */ + public templateId: string + + /** HydratedFourRowTemplate documentMessage. */ + public documentMessage?: proto.IDocumentMessage | null + + /** HydratedFourRowTemplate hydratedTitleText. */ + public hydratedTitleText: string + + /** HydratedFourRowTemplate imageMessage. */ + public imageMessage?: proto.IImageMessage | null + + /** HydratedFourRowTemplate videoMessage. */ + public videoMessage?: proto.IVideoMessage | null + + /** HydratedFourRowTemplate locationMessage. */ + public locationMessage?: proto.ILocationMessage | null + + /** HydratedFourRowTemplate title. */ + public title?: 'documentMessage' | 'hydratedTitleText' | 'imageMessage' | 'videoMessage' | 'locationMessage' + + /** + * Creates a new HydratedFourRowTemplate instance using the specified properties. + * @param [properties] Properties to set + * @returns HydratedFourRowTemplate instance + */ + public static create(properties?: proto.IHydratedFourRowTemplate): proto.HydratedFourRowTemplate + + /** + * Encodes the specified HydratedFourRowTemplate message. Does not implicitly {@link proto.HydratedFourRowTemplate.verify|verify} messages. + * @param message HydratedFourRowTemplate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.IHydratedFourRowTemplate, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Encodes the specified HydratedFourRowTemplate message, length delimited. Does not implicitly {@link proto.HydratedFourRowTemplate.verify|verify} messages. + * @param message HydratedFourRowTemplate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: proto.IHydratedFourRowTemplate, + writer?: $protobuf.Writer, + ): $protobuf.Writer + + /** + * Decodes a HydratedFourRowTemplate message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HydratedFourRowTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): proto.HydratedFourRowTemplate + + /** + * Decodes a HydratedFourRowTemplate message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HydratedFourRowTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): proto.HydratedFourRowTemplate + + /** + * Verifies a HydratedFourRowTemplate message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null + + /** + * Creates a HydratedFourRowTemplate message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HydratedFourRowTemplate + */ + public static fromObject(object: { [k: string]: any }): proto.HydratedFourRowTemplate + + /** + * Creates a plain object from a HydratedFourRowTemplate message. Also converts values to other types if specified. + * @param message HydratedFourRowTemplate + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: proto.HydratedFourRowTemplate, + options?: $protobuf.IConversionOptions, + ): { [k: string]: any } + + /** + * Converts this HydratedFourRowTemplate to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any } + } + + /** Properties of a TemplateMessage. */ + interface ITemplateMessage { + /** TemplateMessage contextInfo */ + contextInfo?: proto.IContextInfo | null + + /** TemplateMessage hydratedTemplate */ + hydratedTemplate?: proto.IHydratedFourRowTemplate | null + + /** TemplateMessage fourRowTemplate */ + fourRowTemplate?: proto.IFourRowTemplate | null + + /** TemplateMessage hydratedFourRowTemplate */ + hydratedFourRowTemplate?: proto.IHydratedFourRowTemplate | null + } + + /** Represents a TemplateMessage. */ + class TemplateMessage implements ITemplateMessage { + /** + * Constructs a new TemplateMessage. + * @param [properties] Properties to set + */ + constructor(properties?: proto.ITemplateMessage) + + /** TemplateMessage contextInfo. */ + public contextInfo?: proto.IContextInfo | null + + /** TemplateMessage hydratedTemplate. */ + public hydratedTemplate?: proto.IHydratedFourRowTemplate | null + + /** TemplateMessage fourRowTemplate. */ + public fourRowTemplate?: proto.IFourRowTemplate | null + + /** TemplateMessage hydratedFourRowTemplate. */ + public hydratedFourRowTemplate?: proto.IHydratedFourRowTemplate | null + + /** TemplateMessage format. */ + public format?: 'fourRowTemplate' | 'hydratedFourRowTemplate' + + /** + * Creates a new TemplateMessage instance using the specified properties. + * @param [properties] Properties to set + * @returns TemplateMessage instance + */ + public static create(properties?: proto.ITemplateMessage): proto.TemplateMessage + + /** + * Encodes the specified TemplateMessage message. Does not implicitly {@link proto.TemplateMessage.verify|verify} messages. + * @param message TemplateMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.ITemplateMessage, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Encodes the specified TemplateMessage message, length delimited. Does not implicitly {@link proto.TemplateMessage.verify|verify} messages. + * @param message TemplateMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.ITemplateMessage, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Decodes a TemplateMessage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TemplateMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): proto.TemplateMessage + + /** + * Decodes a TemplateMessage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TemplateMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): proto.TemplateMessage + + /** + * Verifies a TemplateMessage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null + + /** + * Creates a TemplateMessage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TemplateMessage + */ + public static fromObject(object: { [k: string]: any }): proto.TemplateMessage + + /** + * Creates a plain object from a TemplateMessage message. Also converts values to other types if specified. + * @param message TemplateMessage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: proto.TemplateMessage, + options?: $protobuf.IConversionOptions, + ): { [k: string]: any } + + /** + * Converts this TemplateMessage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any } + } + + /** Properties of a TemplateButtonReplyMessage. */ + interface ITemplateButtonReplyMessage { + /** TemplateButtonReplyMessage selectedId */ + selectedId?: string | null + + /** TemplateButtonReplyMessage selectedDisplayText */ + selectedDisplayText?: string | null + + /** TemplateButtonReplyMessage contextInfo */ + contextInfo?: proto.IContextInfo | null + + /** TemplateButtonReplyMessage selectedIndex */ + selectedIndex?: number | null + } + + /** Represents a TemplateButtonReplyMessage. */ + class TemplateButtonReplyMessage implements ITemplateButtonReplyMessage { + /** + * Constructs a new TemplateButtonReplyMessage. + * @param [properties] Properties to set + */ + constructor(properties?: proto.ITemplateButtonReplyMessage) + + /** TemplateButtonReplyMessage selectedId. */ + public selectedId: string + + /** TemplateButtonReplyMessage selectedDisplayText. */ + public selectedDisplayText: string + + /** TemplateButtonReplyMessage contextInfo. */ + public contextInfo?: proto.IContextInfo | null + + /** TemplateButtonReplyMessage selectedIndex. */ + public selectedIndex: number + + /** + * Creates a new TemplateButtonReplyMessage instance using the specified properties. + * @param [properties] Properties to set + * @returns TemplateButtonReplyMessage instance + */ + public static create(properties?: proto.ITemplateButtonReplyMessage): proto.TemplateButtonReplyMessage + + /** + * Encodes the specified TemplateButtonReplyMessage message. Does not implicitly {@link proto.TemplateButtonReplyMessage.verify|verify} messages. + * @param message TemplateButtonReplyMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.ITemplateButtonReplyMessage, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Encodes the specified TemplateButtonReplyMessage message, length delimited. Does not implicitly {@link proto.TemplateButtonReplyMessage.verify|verify} messages. + * @param message TemplateButtonReplyMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: proto.ITemplateButtonReplyMessage, + writer?: $protobuf.Writer, + ): $protobuf.Writer + + /** + * Decodes a TemplateButtonReplyMessage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TemplateButtonReplyMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): proto.TemplateButtonReplyMessage + + /** + * Decodes a TemplateButtonReplyMessage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TemplateButtonReplyMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): proto.TemplateButtonReplyMessage + + /** + * Verifies a TemplateButtonReplyMessage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null + + /** + * Creates a TemplateButtonReplyMessage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TemplateButtonReplyMessage + */ + public static fromObject(object: { [k: string]: any }): proto.TemplateButtonReplyMessage + + /** + * Creates a plain object from a TemplateButtonReplyMessage message. Also converts values to other types if specified. + * @param message TemplateButtonReplyMessage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: proto.TemplateButtonReplyMessage, + options?: $protobuf.IConversionOptions, + ): { [k: string]: any } + + /** + * Converts this TemplateButtonReplyMessage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any } + } + + /** Properties of a ProductSnapshot. */ + interface IProductSnapshot { + /** ProductSnapshot productImage */ + productImage?: proto.IImageMessage | null + + /** ProductSnapshot productId */ + productId?: string | null + + /** ProductSnapshot title */ + title?: string | null + + /** ProductSnapshot description */ + description?: string | null + + /** ProductSnapshot currencyCode */ + currencyCode?: string | null + + /** ProductSnapshot priceAmount1000 */ + priceAmount1000?: number | Long | null + + /** ProductSnapshot retailerId */ + retailerId?: string | null + + /** ProductSnapshot url */ + url?: string | null + + /** ProductSnapshot productImageCount */ + productImageCount?: number | null + + /** ProductSnapshot firstImageId */ + firstImageId?: string | null + } + + /** Represents a ProductSnapshot. */ + class ProductSnapshot implements IProductSnapshot { + /** + * Constructs a new ProductSnapshot. + * @param [properties] Properties to set + */ + constructor(properties?: proto.IProductSnapshot) + + /** ProductSnapshot productImage. */ + public productImage?: proto.IImageMessage | null + + /** ProductSnapshot productId. */ + public productId: string + + /** ProductSnapshot title. */ + public title: string + + /** ProductSnapshot description. */ + public description: string + + /** ProductSnapshot currencyCode. */ + public currencyCode: string + + /** ProductSnapshot priceAmount1000. */ + public priceAmount1000: number | Long + + /** ProductSnapshot retailerId. */ + public retailerId: string + + /** ProductSnapshot url. */ + public url: string + + /** ProductSnapshot productImageCount. */ + public productImageCount: number + + /** ProductSnapshot firstImageId. */ + public firstImageId: string + + /** + * Creates a new ProductSnapshot instance using the specified properties. + * @param [properties] Properties to set + * @returns ProductSnapshot instance + */ + public static create(properties?: proto.IProductSnapshot): proto.ProductSnapshot + + /** + * Encodes the specified ProductSnapshot message. Does not implicitly {@link proto.ProductSnapshot.verify|verify} messages. + * @param message ProductSnapshot message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.IProductSnapshot, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Encodes the specified ProductSnapshot message, length delimited. Does not implicitly {@link proto.ProductSnapshot.verify|verify} messages. + * @param message ProductSnapshot message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.IProductSnapshot, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Decodes a ProductSnapshot message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProductSnapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): proto.ProductSnapshot + + /** + * Decodes a ProductSnapshot message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProductSnapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): proto.ProductSnapshot + + /** + * Verifies a ProductSnapshot message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null + + /** + * Creates a ProductSnapshot message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProductSnapshot + */ + public static fromObject(object: { [k: string]: any }): proto.ProductSnapshot + + /** + * Creates a plain object from a ProductSnapshot message. Also converts values to other types if specified. + * @param message ProductSnapshot + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: proto.ProductSnapshot, + options?: $protobuf.IConversionOptions, + ): { [k: string]: any } + + /** + * Converts this ProductSnapshot to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any } + } + + /** Properties of a ProductMessage. */ + interface IProductMessage { + /** ProductMessage product */ + product?: proto.IProductSnapshot | null + + /** ProductMessage businessOwnerJid */ + businessOwnerJid?: string | null + + /** ProductMessage contextInfo */ + contextInfo?: proto.IContextInfo | null + } + + /** Represents a ProductMessage. */ + class ProductMessage implements IProductMessage { + /** + * Constructs a new ProductMessage. + * @param [properties] Properties to set + */ + constructor(properties?: proto.IProductMessage) + + /** ProductMessage product. */ + public product?: proto.IProductSnapshot | null + + /** ProductMessage businessOwnerJid. */ + public businessOwnerJid: string + + /** ProductMessage contextInfo. */ + public contextInfo?: proto.IContextInfo | null + + /** + * Creates a new ProductMessage instance using the specified properties. + * @param [properties] Properties to set + * @returns ProductMessage instance + */ + public static create(properties?: proto.IProductMessage): proto.ProductMessage + + /** + * Encodes the specified ProductMessage message. Does not implicitly {@link proto.ProductMessage.verify|verify} messages. + * @param message ProductMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.IProductMessage, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Encodes the specified ProductMessage message, length delimited. Does not implicitly {@link proto.ProductMessage.verify|verify} messages. + * @param message ProductMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.IProductMessage, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Decodes a ProductMessage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProductMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): proto.ProductMessage + + /** + * Decodes a ProductMessage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProductMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): proto.ProductMessage + + /** + * Verifies a ProductMessage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null + + /** + * Creates a ProductMessage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProductMessage + */ + public static fromObject(object: { [k: string]: any }): proto.ProductMessage + + /** + * Creates a plain object from a ProductMessage message. Also converts values to other types if specified. + * @param message ProductMessage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: proto.ProductMessage, + options?: $protobuf.IConversionOptions, + ): { [k: string]: any } + + /** + * Converts this ProductMessage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any } + } + + /** Properties of a GroupInviteMessage. */ + interface IGroupInviteMessage { + /** GroupInviteMessage groupJid */ + groupJid?: string | null + + /** GroupInviteMessage inviteCode */ + inviteCode?: string | null + + /** GroupInviteMessage inviteExpiration */ + inviteExpiration?: number | Long | null + + /** GroupInviteMessage groupName */ + groupName?: string | null + + /** GroupInviteMessage jpegThumbnail */ + jpegThumbnail?: Uint8Array | null + + /** GroupInviteMessage caption */ + caption?: string | null + + /** GroupInviteMessage contextInfo */ + contextInfo?: proto.IContextInfo | null + } + + /** Represents a GroupInviteMessage. */ + class GroupInviteMessage implements IGroupInviteMessage { + /** + * Constructs a new GroupInviteMessage. + * @param [properties] Properties to set + */ + constructor(properties?: proto.IGroupInviteMessage) + + /** GroupInviteMessage groupJid. */ + public groupJid: string + + /** GroupInviteMessage inviteCode. */ + public inviteCode: string + + /** GroupInviteMessage inviteExpiration. */ + public inviteExpiration: number | Long + + /** GroupInviteMessage groupName. */ + public groupName: string + + /** GroupInviteMessage jpegThumbnail. */ + public jpegThumbnail: Uint8Array + + /** GroupInviteMessage caption. */ + public caption: string + + /** GroupInviteMessage contextInfo. */ + public contextInfo?: proto.IContextInfo | null + + /** + * Creates a new GroupInviteMessage instance using the specified properties. + * @param [properties] Properties to set + * @returns GroupInviteMessage instance + */ + public static create(properties?: proto.IGroupInviteMessage): proto.GroupInviteMessage + + /** + * Encodes the specified GroupInviteMessage message. Does not implicitly {@link proto.GroupInviteMessage.verify|verify} messages. + * @param message GroupInviteMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.IGroupInviteMessage, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Encodes the specified GroupInviteMessage message, length delimited. Does not implicitly {@link proto.GroupInviteMessage.verify|verify} messages. + * @param message GroupInviteMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.IGroupInviteMessage, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Decodes a GroupInviteMessage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GroupInviteMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): proto.GroupInviteMessage + + /** + * Decodes a GroupInviteMessage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GroupInviteMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): proto.GroupInviteMessage + + /** + * Verifies a GroupInviteMessage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null + + /** + * Creates a GroupInviteMessage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GroupInviteMessage + */ + public static fromObject(object: { [k: string]: any }): proto.GroupInviteMessage + + /** + * Creates a plain object from a GroupInviteMessage message. Also converts values to other types if specified. + * @param message GroupInviteMessage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: proto.GroupInviteMessage, + options?: $protobuf.IConversionOptions, + ): { [k: string]: any } + + /** + * Converts this GroupInviteMessage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any } + } + + /** Properties of a DeviceSentMessage. */ + interface IDeviceSentMessage { + /** DeviceSentMessage destinationJid */ + destinationJid?: string | null + + /** DeviceSentMessage message */ + message?: proto.IMessage | null + } + + /** Represents a DeviceSentMessage. */ + class DeviceSentMessage implements IDeviceSentMessage { + /** + * Constructs a new DeviceSentMessage. + * @param [properties] Properties to set + */ + constructor(properties?: proto.IDeviceSentMessage) + + /** DeviceSentMessage destinationJid. */ + public destinationJid: string + + /** DeviceSentMessage message. */ + public message?: proto.IMessage | null + + /** + * Creates a new DeviceSentMessage instance using the specified properties. + * @param [properties] Properties to set + * @returns DeviceSentMessage instance + */ + public static create(properties?: proto.IDeviceSentMessage): proto.DeviceSentMessage + + /** + * Encodes the specified DeviceSentMessage message. Does not implicitly {@link proto.DeviceSentMessage.verify|verify} messages. + * @param message DeviceSentMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.IDeviceSentMessage, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Encodes the specified DeviceSentMessage message, length delimited. Does not implicitly {@link proto.DeviceSentMessage.verify|verify} messages. + * @param message DeviceSentMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.IDeviceSentMessage, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Decodes a DeviceSentMessage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeviceSentMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): proto.DeviceSentMessage + + /** + * Decodes a DeviceSentMessage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeviceSentMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): proto.DeviceSentMessage + + /** + * Verifies a DeviceSentMessage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null + + /** + * Creates a DeviceSentMessage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeviceSentMessage + */ + public static fromObject(object: { [k: string]: any }): proto.DeviceSentMessage + + /** + * Creates a plain object from a DeviceSentMessage message. Also converts values to other types if specified. + * @param message DeviceSentMessage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: proto.DeviceSentMessage, + options?: $protobuf.IConversionOptions, + ): { [k: string]: any } + + /** + * Converts this DeviceSentMessage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any } + } + + /** Properties of a DeviceSyncMessage. */ + interface IDeviceSyncMessage { + /** DeviceSyncMessage serializedXmlBytes */ + serializedXmlBytes?: Uint8Array | null + } + + /** Represents a DeviceSyncMessage. */ + class DeviceSyncMessage implements IDeviceSyncMessage { + /** + * Constructs a new DeviceSyncMessage. + * @param [properties] Properties to set + */ + constructor(properties?: proto.IDeviceSyncMessage) + + /** DeviceSyncMessage serializedXmlBytes. */ + public serializedXmlBytes: Uint8Array + + /** + * Creates a new DeviceSyncMessage instance using the specified properties. + * @param [properties] Properties to set + * @returns DeviceSyncMessage instance + */ + public static create(properties?: proto.IDeviceSyncMessage): proto.DeviceSyncMessage + + /** + * Encodes the specified DeviceSyncMessage message. Does not implicitly {@link proto.DeviceSyncMessage.verify|verify} messages. + * @param message DeviceSyncMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.IDeviceSyncMessage, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Encodes the specified DeviceSyncMessage message, length delimited. Does not implicitly {@link proto.DeviceSyncMessage.verify|verify} messages. + * @param message DeviceSyncMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.IDeviceSyncMessage, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Decodes a DeviceSyncMessage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeviceSyncMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): proto.DeviceSyncMessage + + /** + * Decodes a DeviceSyncMessage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeviceSyncMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): proto.DeviceSyncMessage + + /** + * Verifies a DeviceSyncMessage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null + + /** + * Creates a DeviceSyncMessage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeviceSyncMessage + */ + public static fromObject(object: { [k: string]: any }): proto.DeviceSyncMessage + + /** + * Creates a plain object from a DeviceSyncMessage message. Also converts values to other types if specified. + * @param message DeviceSyncMessage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: proto.DeviceSyncMessage, + options?: $protobuf.IConversionOptions, + ): { [k: string]: any } + + /** + * Converts this DeviceSyncMessage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any } + } + + /** Properties of a Message. */ + interface IMessage { + /** Message conversation */ + conversation?: string | null + + /** Message senderKeyDistributionMessage */ + senderKeyDistributionMessage?: proto.ISenderKeyDistributionMessage | null + + /** Message imageMessage */ + imageMessage?: proto.IImageMessage | null + + /** Message contactMessage */ + contactMessage?: proto.IContactMessage | null + + /** Message locationMessage */ + locationMessage?: proto.ILocationMessage | null + + /** Message extendedTextMessage */ + extendedTextMessage?: proto.IExtendedTextMessage | null + + /** Message documentMessage */ + documentMessage?: proto.IDocumentMessage | null + + /** Message audioMessage */ + audioMessage?: proto.IAudioMessage | null + + /** Message videoMessage */ + videoMessage?: proto.IVideoMessage | null + + /** Message call */ + call?: proto.ICall | null + + /** Message chat */ + chat?: proto.IChat | null + + /** Message protocolMessage */ + protocolMessage?: proto.IProtocolMessage | null + + /** Message contactsArrayMessage */ + contactsArrayMessage?: proto.IContactsArrayMessage | null + + /** Message highlyStructuredMessage */ + highlyStructuredMessage?: proto.IHighlyStructuredMessage | null + + /** Message fastRatchetKeySenderKeyDistributionMessage */ + fastRatchetKeySenderKeyDistributionMessage?: proto.ISenderKeyDistributionMessage | null + + /** Message sendPaymentMessage */ + sendPaymentMessage?: proto.ISendPaymentMessage | null + + /** Message liveLocationMessage */ + liveLocationMessage?: proto.ILiveLocationMessage | null + + /** Message requestPaymentMessage */ + requestPaymentMessage?: proto.IRequestPaymentMessage | null + + /** Message declinePaymentRequestMessage */ + declinePaymentRequestMessage?: proto.IDeclinePaymentRequestMessage | null + + /** Message cancelPaymentRequestMessage */ + cancelPaymentRequestMessage?: proto.ICancelPaymentRequestMessage | null + + /** Message templateMessage */ + templateMessage?: proto.ITemplateMessage | null + + /** Message stickerMessage */ + stickerMessage?: proto.IStickerMessage | null + + /** Message groupInviteMessage */ + groupInviteMessage?: proto.IGroupInviteMessage | null + + /** Message templateButtonReplyMessage */ + templateButtonReplyMessage?: proto.ITemplateButtonReplyMessage | null + + /** Message productMessage */ + productMessage?: proto.IProductMessage | null + + /** Message deviceSentMessage */ + deviceSentMessage?: proto.IDeviceSentMessage | null + + /** Message deviceSyncMessage */ + deviceSyncMessage?: proto.IDeviceSyncMessage | null + } + + /** Represents a Message. */ + class Message implements IMessage { + /** + * Constructs a new Message. + * @param [properties] Properties to set + */ + constructor(properties?: proto.IMessage) + + /** Message conversation. */ + public conversation: string + + /** Message senderKeyDistributionMessage. */ + public senderKeyDistributionMessage?: proto.ISenderKeyDistributionMessage | null + + /** Message imageMessage. */ + public imageMessage?: proto.IImageMessage | null + + /** Message contactMessage. */ + public contactMessage?: proto.IContactMessage | null + + /** Message locationMessage. */ + public locationMessage?: proto.ILocationMessage | null + + /** Message extendedTextMessage. */ + public extendedTextMessage?: proto.IExtendedTextMessage | null + + /** Message documentMessage. */ + public documentMessage?: proto.IDocumentMessage | null + + /** Message audioMessage. */ + public audioMessage?: proto.IAudioMessage | null + + /** Message videoMessage. */ + public videoMessage?: proto.IVideoMessage | null + + /** Message call. */ + public call?: proto.ICall | null + + /** Message chat. */ + public chat?: proto.IChat | null + + /** Message protocolMessage. */ + public protocolMessage?: proto.IProtocolMessage | null + + /** Message contactsArrayMessage. */ + public contactsArrayMessage?: proto.IContactsArrayMessage | null + + /** Message highlyStructuredMessage. */ + public highlyStructuredMessage?: proto.IHighlyStructuredMessage | null + + /** Message fastRatchetKeySenderKeyDistributionMessage. */ + public fastRatchetKeySenderKeyDistributionMessage?: proto.ISenderKeyDistributionMessage | null + + /** Message sendPaymentMessage. */ + public sendPaymentMessage?: proto.ISendPaymentMessage | null + + /** Message liveLocationMessage. */ + public liveLocationMessage?: proto.ILiveLocationMessage | null + + /** Message requestPaymentMessage. */ + public requestPaymentMessage?: proto.IRequestPaymentMessage | null + + /** Message declinePaymentRequestMessage. */ + public declinePaymentRequestMessage?: proto.IDeclinePaymentRequestMessage | null + + /** Message cancelPaymentRequestMessage. */ + public cancelPaymentRequestMessage?: proto.ICancelPaymentRequestMessage | null + + /** Message templateMessage. */ + public templateMessage?: proto.ITemplateMessage | null + + /** Message stickerMessage. */ + public stickerMessage?: proto.IStickerMessage | null + + /** Message groupInviteMessage. */ + public groupInviteMessage?: proto.IGroupInviteMessage | null + + /** Message templateButtonReplyMessage. */ + public templateButtonReplyMessage?: proto.ITemplateButtonReplyMessage | null + + /** Message productMessage. */ + public productMessage?: proto.IProductMessage | null + + /** Message deviceSentMessage. */ + public deviceSentMessage?: proto.IDeviceSentMessage | null + + /** Message deviceSyncMessage. */ + public deviceSyncMessage?: proto.IDeviceSyncMessage | null + + /** + * Creates a new Message instance using the specified properties. + * @param [properties] Properties to set + * @returns Message instance + */ + public static create(properties?: proto.IMessage): proto.Message + + /** + * Encodes the specified Message message. Does not implicitly {@link proto.Message.verify|verify} messages. + * @param message Message message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.IMessage, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Encodes the specified Message message, length delimited. Does not implicitly {@link proto.Message.verify|verify} messages. + * @param message Message message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.IMessage, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Decodes a Message message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): proto.Message + + /** + * Decodes a Message message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): proto.Message + + /** + * Verifies a Message message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null + + /** + * Creates a Message message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Message + */ + public static fromObject(object: { [k: string]: any }): proto.Message + + /** + * Creates a plain object from a Message message. Also converts values to other types if specified. + * @param message Message + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: proto.Message, options?: $protobuf.IConversionOptions): { [k: string]: any } + + /** + * Converts this Message to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any } + } + + /** Properties of a MessageKey. */ + interface IMessageKey { + /** MessageKey remoteJid */ + remoteJid?: string | null + + /** MessageKey fromMe */ + fromMe?: boolean | null + + /** MessageKey id */ + id?: string | null + + /** MessageKey participant */ + participant?: string | null + } + + /** Represents a MessageKey. */ + class MessageKey implements IMessageKey { + /** + * Constructs a new MessageKey. + * @param [properties] Properties to set + */ + constructor(properties?: proto.IMessageKey) + + /** MessageKey remoteJid. */ + public remoteJid: string + + /** MessageKey fromMe. */ + public fromMe: boolean + + /** MessageKey id. */ + public id: string + + /** MessageKey participant. */ + public participant: string + + /** + * Creates a new MessageKey instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageKey instance + */ + public static create(properties?: proto.IMessageKey): proto.MessageKey + + /** + * Encodes the specified MessageKey message. Does not implicitly {@link proto.MessageKey.verify|verify} messages. + * @param message MessageKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.IMessageKey, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Encodes the specified MessageKey message, length delimited. Does not implicitly {@link proto.MessageKey.verify|verify} messages. + * @param message MessageKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.IMessageKey, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Decodes a MessageKey message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): proto.MessageKey + + /** + * Decodes a MessageKey message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): proto.MessageKey + + /** + * Verifies a MessageKey message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null + + /** + * Creates a MessageKey message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageKey + */ + public static fromObject(object: { [k: string]: any }): proto.MessageKey + + /** + * Creates a plain object from a MessageKey message. Also converts values to other types if specified. + * @param message MessageKey + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: proto.MessageKey, options?: $protobuf.IConversionOptions): { [k: string]: any } + + /** + * Converts this MessageKey to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any } + } + + /** Properties of a WebFeatures. */ + interface IWebFeatures { + /** WebFeatures labelsDisplay */ + labelsDisplay?: proto.WebFeatures.WEB_FEATURES_FLAG | null + + /** WebFeatures voipIndividualOutgoing */ + voipIndividualOutgoing?: proto.WebFeatures.WEB_FEATURES_FLAG | null + + /** WebFeatures groupsV3 */ + groupsV3?: proto.WebFeatures.WEB_FEATURES_FLAG | null + + /** WebFeatures groupsV3Create */ + groupsV3Create?: proto.WebFeatures.WEB_FEATURES_FLAG | null + + /** WebFeatures changeNumberV2 */ + changeNumberV2?: proto.WebFeatures.WEB_FEATURES_FLAG | null + + /** WebFeatures queryStatusV3Thumbnail */ + queryStatusV3Thumbnail?: proto.WebFeatures.WEB_FEATURES_FLAG | null + + /** WebFeatures liveLocations */ + liveLocations?: proto.WebFeatures.WEB_FEATURES_FLAG | null + + /** WebFeatures queryVname */ + queryVname?: proto.WebFeatures.WEB_FEATURES_FLAG | null + + /** WebFeatures voipIndividualIncoming */ + voipIndividualIncoming?: proto.WebFeatures.WEB_FEATURES_FLAG | null + + /** WebFeatures quickRepliesQuery */ + quickRepliesQuery?: proto.WebFeatures.WEB_FEATURES_FLAG | null + + /** WebFeatures payments */ + payments?: proto.WebFeatures.WEB_FEATURES_FLAG | null + + /** WebFeatures stickerPackQuery */ + stickerPackQuery?: proto.WebFeatures.WEB_FEATURES_FLAG | null + + /** WebFeatures liveLocationsFinal */ + liveLocationsFinal?: proto.WebFeatures.WEB_FEATURES_FLAG | null + + /** WebFeatures labelsEdit */ + labelsEdit?: proto.WebFeatures.WEB_FEATURES_FLAG | null + + /** WebFeatures mediaUpload */ + mediaUpload?: proto.WebFeatures.WEB_FEATURES_FLAG | null + + /** WebFeatures mediaUploadRichQuickReplies */ + mediaUploadRichQuickReplies?: proto.WebFeatures.WEB_FEATURES_FLAG | null + + /** WebFeatures vnameV2 */ + vnameV2?: proto.WebFeatures.WEB_FEATURES_FLAG | null + + /** WebFeatures videoPlaybackUrl */ + videoPlaybackUrl?: proto.WebFeatures.WEB_FEATURES_FLAG | null + + /** WebFeatures statusRanking */ + statusRanking?: proto.WebFeatures.WEB_FEATURES_FLAG | null + + /** WebFeatures voipIndividualVideo */ + voipIndividualVideo?: proto.WebFeatures.WEB_FEATURES_FLAG | null + + /** WebFeatures thirdPartyStickers */ + thirdPartyStickers?: proto.WebFeatures.WEB_FEATURES_FLAG | null + + /** WebFeatures frequentlyForwardedSetting */ + frequentlyForwardedSetting?: proto.WebFeatures.WEB_FEATURES_FLAG | null + + /** WebFeatures groupsV4JoinPermission */ + groupsV4JoinPermission?: proto.WebFeatures.WEB_FEATURES_FLAG | null + + /** WebFeatures recentStickers */ + recentStickers?: proto.WebFeatures.WEB_FEATURES_FLAG | null + + /** WebFeatures catalog */ + catalog?: proto.WebFeatures.WEB_FEATURES_FLAG | null + + /** WebFeatures starredStickers */ + starredStickers?: proto.WebFeatures.WEB_FEATURES_FLAG | null + + /** WebFeatures voipGroupCall */ + voipGroupCall?: proto.WebFeatures.WEB_FEATURES_FLAG | null + + /** WebFeatures templateMessage */ + templateMessage?: proto.WebFeatures.WEB_FEATURES_FLAG | null + + /** WebFeatures templateMessageInteractivity */ + templateMessageInteractivity?: proto.WebFeatures.WEB_FEATURES_FLAG | null + + /** WebFeatures ephemeralMessages */ + ephemeralMessages?: proto.WebFeatures.WEB_FEATURES_FLAG | null + } + + /** Represents a WebFeatures. */ + class WebFeatures implements IWebFeatures { + /** + * Constructs a new WebFeatures. + * @param [properties] Properties to set + */ + constructor(properties?: proto.IWebFeatures) + + /** WebFeatures labelsDisplay. */ + public labelsDisplay: proto.WebFeatures.WEB_FEATURES_FLAG + + /** WebFeatures voipIndividualOutgoing. */ + public voipIndividualOutgoing: proto.WebFeatures.WEB_FEATURES_FLAG + + /** WebFeatures groupsV3. */ + public groupsV3: proto.WebFeatures.WEB_FEATURES_FLAG + + /** WebFeatures groupsV3Create. */ + public groupsV3Create: proto.WebFeatures.WEB_FEATURES_FLAG + + /** WebFeatures changeNumberV2. */ + public changeNumberV2: proto.WebFeatures.WEB_FEATURES_FLAG + + /** WebFeatures queryStatusV3Thumbnail. */ + public queryStatusV3Thumbnail: proto.WebFeatures.WEB_FEATURES_FLAG + + /** WebFeatures liveLocations. */ + public liveLocations: proto.WebFeatures.WEB_FEATURES_FLAG + + /** WebFeatures queryVname. */ + public queryVname: proto.WebFeatures.WEB_FEATURES_FLAG + + /** WebFeatures voipIndividualIncoming. */ + public voipIndividualIncoming: proto.WebFeatures.WEB_FEATURES_FLAG + + /** WebFeatures quickRepliesQuery. */ + public quickRepliesQuery: proto.WebFeatures.WEB_FEATURES_FLAG + + /** WebFeatures payments. */ + public payments: proto.WebFeatures.WEB_FEATURES_FLAG + + /** WebFeatures stickerPackQuery. */ + public stickerPackQuery: proto.WebFeatures.WEB_FEATURES_FLAG + + /** WebFeatures liveLocationsFinal. */ + public liveLocationsFinal: proto.WebFeatures.WEB_FEATURES_FLAG + + /** WebFeatures labelsEdit. */ + public labelsEdit: proto.WebFeatures.WEB_FEATURES_FLAG + + /** WebFeatures mediaUpload. */ + public mediaUpload: proto.WebFeatures.WEB_FEATURES_FLAG + + /** WebFeatures mediaUploadRichQuickReplies. */ + public mediaUploadRichQuickReplies: proto.WebFeatures.WEB_FEATURES_FLAG + + /** WebFeatures vnameV2. */ + public vnameV2: proto.WebFeatures.WEB_FEATURES_FLAG + + /** WebFeatures videoPlaybackUrl. */ + public videoPlaybackUrl: proto.WebFeatures.WEB_FEATURES_FLAG + + /** WebFeatures statusRanking. */ + public statusRanking: proto.WebFeatures.WEB_FEATURES_FLAG + + /** WebFeatures voipIndividualVideo. */ + public voipIndividualVideo: proto.WebFeatures.WEB_FEATURES_FLAG + + /** WebFeatures thirdPartyStickers. */ + public thirdPartyStickers: proto.WebFeatures.WEB_FEATURES_FLAG + + /** WebFeatures frequentlyForwardedSetting. */ + public frequentlyForwardedSetting: proto.WebFeatures.WEB_FEATURES_FLAG + + /** WebFeatures groupsV4JoinPermission. */ + public groupsV4JoinPermission: proto.WebFeatures.WEB_FEATURES_FLAG + + /** WebFeatures recentStickers. */ + public recentStickers: proto.WebFeatures.WEB_FEATURES_FLAG + + /** WebFeatures catalog. */ + public catalog: proto.WebFeatures.WEB_FEATURES_FLAG + + /** WebFeatures starredStickers. */ + public starredStickers: proto.WebFeatures.WEB_FEATURES_FLAG + + /** WebFeatures voipGroupCall. */ + public voipGroupCall: proto.WebFeatures.WEB_FEATURES_FLAG + + /** WebFeatures templateMessage. */ + public templateMessage: proto.WebFeatures.WEB_FEATURES_FLAG + + /** WebFeatures templateMessageInteractivity. */ + public templateMessageInteractivity: proto.WebFeatures.WEB_FEATURES_FLAG + + /** WebFeatures ephemeralMessages. */ + public ephemeralMessages: proto.WebFeatures.WEB_FEATURES_FLAG + + /** + * Creates a new WebFeatures instance using the specified properties. + * @param [properties] Properties to set + * @returns WebFeatures instance + */ + public static create(properties?: proto.IWebFeatures): proto.WebFeatures + + /** + * Encodes the specified WebFeatures message. Does not implicitly {@link proto.WebFeatures.verify|verify} messages. + * @param message WebFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.IWebFeatures, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Encodes the specified WebFeatures message, length delimited. Does not implicitly {@link proto.WebFeatures.verify|verify} messages. + * @param message WebFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.IWebFeatures, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Decodes a WebFeatures message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WebFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): proto.WebFeatures + + /** + * Decodes a WebFeatures message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WebFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): proto.WebFeatures + + /** + * Verifies a WebFeatures message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null + + /** + * Creates a WebFeatures message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WebFeatures + */ + public static fromObject(object: { [k: string]: any }): proto.WebFeatures + + /** + * Creates a plain object from a WebFeatures message. Also converts values to other types if specified. + * @param message WebFeatures + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: proto.WebFeatures, options?: $protobuf.IConversionOptions): { [k: string]: any } + + /** + * Converts this WebFeatures to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any } + } + + namespace WebFeatures { + /** WEB_FEATURES_FLAG enum. */ + enum WEB_FEATURES_FLAG { + NOT_STARTED = 0, + FORCE_UPGRADE = 1, + DEVELOPMENT = 2, + PRODUCTION = 3, + } + } + + /** Properties of a TabletNotificationsInfo. */ + interface ITabletNotificationsInfo { + /** TabletNotificationsInfo timestamp */ + timestamp?: number | Long | null + + /** TabletNotificationsInfo unreadChats */ + unreadChats?: number | null + + /** TabletNotificationsInfo notifyMessageCount */ + notifyMessageCount?: number | null + + /** TabletNotificationsInfo notifyMessage */ + notifyMessage?: proto.INotificationMessageInfo[] | null + } + + /** Represents a TabletNotificationsInfo. */ + class TabletNotificationsInfo implements ITabletNotificationsInfo { + /** + * Constructs a new TabletNotificationsInfo. + * @param [properties] Properties to set + */ + constructor(properties?: proto.ITabletNotificationsInfo) + + /** TabletNotificationsInfo timestamp. */ + public timestamp: number | Long + + /** TabletNotificationsInfo unreadChats. */ + public unreadChats: number + + /** TabletNotificationsInfo notifyMessageCount. */ + public notifyMessageCount: number + + /** TabletNotificationsInfo notifyMessage. */ + public notifyMessage: proto.INotificationMessageInfo[] + + /** + * Creates a new TabletNotificationsInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns TabletNotificationsInfo instance + */ + public static create(properties?: proto.ITabletNotificationsInfo): proto.TabletNotificationsInfo + + /** + * Encodes the specified TabletNotificationsInfo message. Does not implicitly {@link proto.TabletNotificationsInfo.verify|verify} messages. + * @param message TabletNotificationsInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.ITabletNotificationsInfo, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Encodes the specified TabletNotificationsInfo message, length delimited. Does not implicitly {@link proto.TabletNotificationsInfo.verify|verify} messages. + * @param message TabletNotificationsInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: proto.ITabletNotificationsInfo, + writer?: $protobuf.Writer, + ): $protobuf.Writer + + /** + * Decodes a TabletNotificationsInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TabletNotificationsInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): proto.TabletNotificationsInfo + + /** + * Decodes a TabletNotificationsInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TabletNotificationsInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): proto.TabletNotificationsInfo + + /** + * Verifies a TabletNotificationsInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null + + /** + * Creates a TabletNotificationsInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TabletNotificationsInfo + */ + public static fromObject(object: { [k: string]: any }): proto.TabletNotificationsInfo + + /** + * Creates a plain object from a TabletNotificationsInfo message. Also converts values to other types if specified. + * @param message TabletNotificationsInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: proto.TabletNotificationsInfo, + options?: $protobuf.IConversionOptions, + ): { [k: string]: any } + + /** + * Converts this TabletNotificationsInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any } + } + + /** Properties of a NotificationMessageInfo. */ + interface INotificationMessageInfo { + /** NotificationMessageInfo key */ + key?: proto.IMessageKey | null + + /** NotificationMessageInfo message */ + message?: proto.IMessage | null + + /** NotificationMessageInfo messageTimestamp */ + messageTimestamp?: number | Long | null + + /** NotificationMessageInfo participant */ + participant?: string | null + } + + /** Represents a NotificationMessageInfo. */ + class NotificationMessageInfo implements INotificationMessageInfo { + /** + * Constructs a new NotificationMessageInfo. + * @param [properties] Properties to set + */ + constructor(properties?: proto.INotificationMessageInfo) + + /** NotificationMessageInfo key. */ + public key?: proto.IMessageKey | null + + /** NotificationMessageInfo message. */ + public message?: proto.IMessage | null + + /** NotificationMessageInfo messageTimestamp. */ + public messageTimestamp: number | Long + + /** NotificationMessageInfo participant. */ + public participant: string + + /** + * Creates a new NotificationMessageInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns NotificationMessageInfo instance + */ + public static create(properties?: proto.INotificationMessageInfo): proto.NotificationMessageInfo + + /** + * Encodes the specified NotificationMessageInfo message. Does not implicitly {@link proto.NotificationMessageInfo.verify|verify} messages. + * @param message NotificationMessageInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.INotificationMessageInfo, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Encodes the specified NotificationMessageInfo message, length delimited. Does not implicitly {@link proto.NotificationMessageInfo.verify|verify} messages. + * @param message NotificationMessageInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: proto.INotificationMessageInfo, + writer?: $protobuf.Writer, + ): $protobuf.Writer + + /** + * Decodes a NotificationMessageInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NotificationMessageInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): proto.NotificationMessageInfo + + /** + * Decodes a NotificationMessageInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NotificationMessageInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): proto.NotificationMessageInfo + + /** + * Verifies a NotificationMessageInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null + + /** + * Creates a NotificationMessageInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NotificationMessageInfo + */ + public static fromObject(object: { [k: string]: any }): proto.NotificationMessageInfo + + /** + * Creates a plain object from a NotificationMessageInfo message. Also converts values to other types if specified. + * @param message NotificationMessageInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: proto.NotificationMessageInfo, + options?: $protobuf.IConversionOptions, + ): { [k: string]: any } + + /** + * Converts this NotificationMessageInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any } + } + + /** Properties of a WebNotificationsInfo. */ + interface IWebNotificationsInfo { + /** WebNotificationsInfo timestamp */ + timestamp?: number | Long | null + + /** WebNotificationsInfo unreadChats */ + unreadChats?: number | null + + /** WebNotificationsInfo notifyMessageCount */ + notifyMessageCount?: number | null + + /** WebNotificationsInfo notifyMessages */ + notifyMessages?: proto.IWebMessageInfo[] | null + } + + /** Represents a WebNotificationsInfo. */ + class WebNotificationsInfo implements IWebNotificationsInfo { + /** + * Constructs a new WebNotificationsInfo. + * @param [properties] Properties to set + */ + constructor(properties?: proto.IWebNotificationsInfo) + + /** WebNotificationsInfo timestamp. */ + public timestamp: number | Long + + /** WebNotificationsInfo unreadChats. */ + public unreadChats: number + + /** WebNotificationsInfo notifyMessageCount. */ + public notifyMessageCount: number + + /** WebNotificationsInfo notifyMessages. */ + public notifyMessages: proto.IWebMessageInfo[] + + /** + * Creates a new WebNotificationsInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns WebNotificationsInfo instance + */ + public static create(properties?: proto.IWebNotificationsInfo): proto.WebNotificationsInfo + + /** + * Encodes the specified WebNotificationsInfo message. Does not implicitly {@link proto.WebNotificationsInfo.verify|verify} messages. + * @param message WebNotificationsInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.IWebNotificationsInfo, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Encodes the specified WebNotificationsInfo message, length delimited. Does not implicitly {@link proto.WebNotificationsInfo.verify|verify} messages. + * @param message WebNotificationsInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.IWebNotificationsInfo, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Decodes a WebNotificationsInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WebNotificationsInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): proto.WebNotificationsInfo + + /** + * Decodes a WebNotificationsInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WebNotificationsInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): proto.WebNotificationsInfo + + /** + * Verifies a WebNotificationsInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null + + /** + * Creates a WebNotificationsInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WebNotificationsInfo + */ + public static fromObject(object: { [k: string]: any }): proto.WebNotificationsInfo + + /** + * Creates a plain object from a WebNotificationsInfo message. Also converts values to other types if specified. + * @param message WebNotificationsInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: proto.WebNotificationsInfo, + options?: $protobuf.IConversionOptions, + ): { [k: string]: any } + + /** + * Converts this WebNotificationsInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any } + } + + /** Properties of a PaymentInfo. */ + interface IPaymentInfo { + /** PaymentInfo amount1000 */ + amount1000?: number | Long | null + + /** PaymentInfo receiverJid */ + receiverJid?: string | null + + /** PaymentInfo status */ + status?: proto.PaymentInfo.PAYMENT_INFO_STATUS | null + + /** PaymentInfo transactionTimestamp */ + transactionTimestamp?: number | Long | null + + /** PaymentInfo requestMessageKey */ + requestMessageKey?: proto.IMessageKey | null + + /** PaymentInfo expiryTimestamp */ + expiryTimestamp?: number | Long | null + + /** PaymentInfo futureproofed */ + futureproofed?: boolean | null + + /** PaymentInfo currency */ + currency?: string | null + } + + /** Represents a PaymentInfo. */ + class PaymentInfo implements IPaymentInfo { + /** + * Constructs a new PaymentInfo. + * @param [properties] Properties to set + */ + constructor(properties?: proto.IPaymentInfo) + + /** PaymentInfo amount1000. */ + public amount1000: number | Long + + /** PaymentInfo receiverJid. */ + public receiverJid: string + + /** PaymentInfo status. */ + public status: proto.PaymentInfo.PAYMENT_INFO_STATUS + + /** PaymentInfo transactionTimestamp. */ + public transactionTimestamp: number | Long + + /** PaymentInfo requestMessageKey. */ + public requestMessageKey?: proto.IMessageKey | null + + /** PaymentInfo expiryTimestamp. */ + public expiryTimestamp: number | Long + + /** PaymentInfo futureproofed. */ + public futureproofed: boolean + + /** PaymentInfo currency. */ + public currency: string + + /** + * Creates a new PaymentInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns PaymentInfo instance + */ + public static create(properties?: proto.IPaymentInfo): proto.PaymentInfo + + /** + * Encodes the specified PaymentInfo message. Does not implicitly {@link proto.PaymentInfo.verify|verify} messages. + * @param message PaymentInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.IPaymentInfo, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Encodes the specified PaymentInfo message, length delimited. Does not implicitly {@link proto.PaymentInfo.verify|verify} messages. + * @param message PaymentInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.IPaymentInfo, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Decodes a PaymentInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PaymentInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): proto.PaymentInfo + + /** + * Decodes a PaymentInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PaymentInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): proto.PaymentInfo + + /** + * Verifies a PaymentInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null + + /** + * Creates a PaymentInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PaymentInfo + */ + public static fromObject(object: { [k: string]: any }): proto.PaymentInfo + + /** + * Creates a plain object from a PaymentInfo message. Also converts values to other types if specified. + * @param message PaymentInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: proto.PaymentInfo, options?: $protobuf.IConversionOptions): { [k: string]: any } + + /** + * Converts this PaymentInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any } + } + + namespace PaymentInfo { + /** PAYMENT_INFO_STATUS enum. */ + enum PAYMENT_INFO_STATUS { + UNKNOWN_STATUS = 0, + PROCESSING = 1, + SENT = 2, + NEED_TO_ACCEPT = 3, + COMPLETE = 4, + COULD_NOT_COMPLETE = 5, + REFUNDED = 6, + EXPIRED = 7, + REJECTED = 8, + CANCELLED = 9, + WAITING_FOR_PAYER = 10, + WAITING = 11, + } + } + + /** Properties of a WebMessageInfo. */ + interface IWebMessageInfo { + /** WebMessageInfo key */ + key: proto.IMessageKey + + /** WebMessageInfo message */ + message?: proto.IMessage | null + + /** WebMessageInfo messageTimestamp */ + messageTimestamp?: number | Long | null + + /** WebMessageInfo status */ + status?: proto.WebMessageInfo.WEB_MESSAGE_INFO_STATUS | null + + /** WebMessageInfo participant */ + participant?: string | null + + /** WebMessageInfo ignore */ + ignore?: boolean | null + + /** WebMessageInfo starred */ + starred?: boolean | null + + /** WebMessageInfo broadcast */ + broadcast?: boolean | null + + /** WebMessageInfo pushName */ + pushName?: string | null + + /** WebMessageInfo mediaCiphertextSha256 */ + mediaCiphertextSha256?: Uint8Array | null + + /** WebMessageInfo multicast */ + multicast?: boolean | null + + /** WebMessageInfo urlText */ + urlText?: boolean | null + + /** WebMessageInfo urlNumber */ + urlNumber?: boolean | null + + /** WebMessageInfo messageStubType */ + messageStubType?: proto.WebMessageInfo.WEB_MESSAGE_INFO_STUBTYPE | null + + /** WebMessageInfo clearMedia */ + clearMedia?: boolean | null + + /** WebMessageInfo messageStubParameters */ + messageStubParameters?: string[] | null + + /** WebMessageInfo duration */ + duration?: number | null + + /** WebMessageInfo labels */ + labels?: string[] | null + + /** WebMessageInfo paymentInfo */ + paymentInfo?: proto.IPaymentInfo | null + + /** WebMessageInfo finalLiveLocation */ + finalLiveLocation?: proto.ILiveLocationMessage | null + + /** WebMessageInfo quotedPaymentInfo */ + quotedPaymentInfo?: proto.IPaymentInfo | null + + /** WebMessageInfo ephemeralStartTimestamp */ + ephemeralStartTimestamp?: number | Long | null + + /** WebMessageInfo ephemeralDuration */ + ephemeralDuration?: number | null + } + + /** Represents a WebMessageInfo. */ + class WebMessageInfo implements IWebMessageInfo { + /** + * Constructs a new WebMessageInfo. + * @param [properties] Properties to set + */ + constructor(properties?: proto.IWebMessageInfo) + + /** WebMessageInfo key. */ + public key: proto.IMessageKey + + /** WebMessageInfo message. */ + public message?: proto.IMessage | null + + /** WebMessageInfo messageTimestamp. */ + public messageTimestamp: number | Long + + /** WebMessageInfo status. */ + public status: proto.WebMessageInfo.WEB_MESSAGE_INFO_STATUS + + /** WebMessageInfo participant. */ + public participant: string + + /** WebMessageInfo ignore. */ + public ignore: boolean + + /** WebMessageInfo starred. */ + public starred: boolean + + /** WebMessageInfo broadcast. */ + public broadcast: boolean + + /** WebMessageInfo pushName. */ + public pushName: string + + /** WebMessageInfo mediaCiphertextSha256. */ + public mediaCiphertextSha256: Uint8Array + + /** WebMessageInfo multicast. */ + public multicast: boolean + + /** WebMessageInfo urlText. */ + public urlText: boolean + + /** WebMessageInfo urlNumber. */ + public urlNumber: boolean + + /** WebMessageInfo messageStubType. */ + public messageStubType: proto.WebMessageInfo.WEB_MESSAGE_INFO_STUBTYPE + + /** WebMessageInfo clearMedia. */ + public clearMedia: boolean + + /** WebMessageInfo messageStubParameters. */ + public messageStubParameters: string[] + + /** WebMessageInfo duration. */ + public duration: number + + /** WebMessageInfo labels. */ + public labels: string[] + + /** WebMessageInfo paymentInfo. */ + public paymentInfo?: proto.IPaymentInfo | null + + /** WebMessageInfo finalLiveLocation. */ + public finalLiveLocation?: proto.ILiveLocationMessage | null + + /** WebMessageInfo quotedPaymentInfo. */ + public quotedPaymentInfo?: proto.IPaymentInfo | null + + /** WebMessageInfo ephemeralStartTimestamp. */ + public ephemeralStartTimestamp: number | Long + + /** WebMessageInfo ephemeralDuration. */ + public ephemeralDuration: number + + /** + * Creates a new WebMessageInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns WebMessageInfo instance + */ + public static create(properties?: proto.IWebMessageInfo): proto.WebMessageInfo + + /** + * Encodes the specified WebMessageInfo message. Does not implicitly {@link proto.WebMessageInfo.verify|verify} messages. + * @param message WebMessageInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.IWebMessageInfo, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Encodes the specified WebMessageInfo message, length delimited. Does not implicitly {@link proto.WebMessageInfo.verify|verify} messages. + * @param message WebMessageInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.IWebMessageInfo, writer?: $protobuf.Writer): $protobuf.Writer + + /** + * Decodes a WebMessageInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WebMessageInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): proto.WebMessageInfo + + /** + * Decodes a WebMessageInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WebMessageInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): proto.WebMessageInfo + + /** + * Verifies a WebMessageInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null + + /** + * Creates a WebMessageInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WebMessageInfo + */ + public static fromObject(object: { [k: string]: any }): proto.WebMessageInfo + + /** + * Creates a plain object from a WebMessageInfo message. Also converts values to other types if specified. + * @param message WebMessageInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: proto.WebMessageInfo, + options?: $protobuf.IConversionOptions, + ): { [k: string]: any } + + /** + * Converts this WebMessageInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any } + } + + namespace WebMessageInfo { + /** WEB_MESSAGE_INFO_STATUS enum. */ + enum WEB_MESSAGE_INFO_STATUS { + ERROR = 0, + PENDING = 1, + SERVER_ACK = 2, + DELIVERY_ACK = 3, + READ = 4, + PLAYED = 5, + } + + /** WEB_MESSAGE_INFO_STUBTYPE enum. */ + enum WEB_MESSAGE_INFO_STUBTYPE { + UNKNOWN = 0, + REVOKE = 1, + CIPHERTEXT = 2, + FUTUREPROOF = 3, + NON_VERIFIED_TRANSITION = 4, + UNVERIFIED_TRANSITION = 5, + VERIFIED_TRANSITION = 6, + VERIFIED_LOW_UNKNOWN = 7, + VERIFIED_HIGH = 8, + VERIFIED_INITIAL_UNKNOWN = 9, + VERIFIED_INITIAL_LOW = 10, + VERIFIED_INITIAL_HIGH = 11, + VERIFIED_TRANSITION_ANY_TO_NONE = 12, + VERIFIED_TRANSITION_ANY_TO_HIGH = 13, + VERIFIED_TRANSITION_HIGH_TO_LOW = 14, + VERIFIED_TRANSITION_HIGH_TO_UNKNOWN = 15, + VERIFIED_TRANSITION_UNKNOWN_TO_LOW = 16, + VERIFIED_TRANSITION_LOW_TO_UNKNOWN = 17, + VERIFIED_TRANSITION_NONE_TO_LOW = 18, + VERIFIED_TRANSITION_NONE_TO_UNKNOWN = 19, + GROUP_CREATE = 20, + GROUP_CHANGE_SUBJECT = 21, + GROUP_CHANGE_ICON = 22, + GROUP_CHANGE_INVITE_LINK = 23, + GROUP_CHANGE_DESCRIPTION = 24, + GROUP_CHANGE_RESTRICT = 25, + GROUP_CHANGE_ANNOUNCE = 26, + GROUP_PARTICIPANT_ADD = 27, + GROUP_PARTICIPANT_REMOVE = 28, + GROUP_PARTICIPANT_PROMOTE = 29, + GROUP_PARTICIPANT_DEMOTE = 30, + GROUP_PARTICIPANT_INVITE = 31, + GROUP_PARTICIPANT_LEAVE = 32, + GROUP_PARTICIPANT_CHANGE_NUMBER = 33, + BROADCAST_CREATE = 34, + BROADCAST_ADD = 35, + BROADCAST_REMOVE = 36, + GENERIC_NOTIFICATION = 37, + E2E_IDENTITY_CHANGED = 38, + E2E_ENCRYPTED = 39, + CALL_MISSED_VOICE = 40, + CALL_MISSED_VIDEO = 41, + INDIVIDUAL_CHANGE_NUMBER = 42, + GROUP_DELETE = 43, + GROUP_ANNOUNCE_MODE_MESSAGE_BOUNCE = 44, + CALL_MISSED_GROUP_VOICE = 45, + CALL_MISSED_GROUP_VIDEO = 46, + PAYMENT_CIPHERTEXT = 47, + PAYMENT_FUTUREPROOF = 48, + PAYMENT_TRANSACTION_STATUS_UPDATE_FAILED = 49, + PAYMENT_TRANSACTION_STATUS_UPDATE_REFUNDED = 50, + PAYMENT_TRANSACTION_STATUS_UPDATE_REFUND_FAILED = 51, + PAYMENT_TRANSACTION_STATUS_RECEIVER_PENDING_SETUP = 52, + PAYMENT_TRANSACTION_STATUS_RECEIVER_SUCCESS_AFTER_HICCUP = 53, + PAYMENT_ACTION_ACCOUNT_SETUP_REMINDER = 54, + PAYMENT_ACTION_SEND_PAYMENT_REMINDER = 55, + PAYMENT_ACTION_SEND_PAYMENT_INVITATION = 56, + PAYMENT_ACTION_REQUEST_DECLINED = 57, + PAYMENT_ACTION_REQUEST_EXPIRED = 58, + PAYMENT_ACTION_REQUEST_CANCELLED = 59, + BIZ_VERIFIED_TRANSITION_TOP_TO_BOTTOM = 60, + BIZ_VERIFIED_TRANSITION_BOTTOM_TO_TOP = 61, + BIZ_INTRO_TOP = 62, + BIZ_INTRO_BOTTOM = 63, + BIZ_NAME_CHANGE = 64, + BIZ_MOVE_TO_CONSUMER_APP = 65, + BIZ_TWO_TIER_MIGRATION_TOP = 66, + BIZ_TWO_TIER_MIGRATION_BOTTOM = 67, + OVERSIZED = 68, + GROUP_CHANGE_NO_FREQUENTLY_FORWARDED = 69, + GROUP_V4_ADD_INVITE_SENT = 70, + GROUP_PARTICIPANT_ADD_REQUEST_JOIN = 71, + CHANGE_EPHEMERAL_SETTING = 72, + } + } +} diff --git a/Binary/WAMessage.js b/Binary/WAMessage.js new file mode 100644 index 0000000..615254e --- /dev/null +++ b/Binary/WAMessage.js @@ -0,0 +1,19977 @@ +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +"use strict"; + +var $protobuf = require("protobufjs/minimal"); + +// Common aliases +var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + +// Exported root namespace +var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {}); + +$root.proto = (function() { + + /** + * Namespace proto. + * @exports proto + * @namespace + */ + var proto = {}; + + proto.HydratedQuickReplyButton = (function() { + + /** + * Properties of a HydratedQuickReplyButton. + * @memberof proto + * @interface IHydratedQuickReplyButton + * @property {string|null} [displayText] HydratedQuickReplyButton displayText + * @property {string|null} [id] HydratedQuickReplyButton id + */ + + /** + * Constructs a new HydratedQuickReplyButton. + * @memberof proto + * @classdesc Represents a HydratedQuickReplyButton. + * @implements IHydratedQuickReplyButton + * @constructor + * @param {proto.IHydratedQuickReplyButton=} [properties] Properties to set + */ + function HydratedQuickReplyButton(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HydratedQuickReplyButton displayText. + * @member {string} displayText + * @memberof proto.HydratedQuickReplyButton + * @instance + */ + HydratedQuickReplyButton.prototype.displayText = ""; + + /** + * HydratedQuickReplyButton id. + * @member {string} id + * @memberof proto.HydratedQuickReplyButton + * @instance + */ + HydratedQuickReplyButton.prototype.id = ""; + + /** + * Creates a new HydratedQuickReplyButton instance using the specified properties. + * @function create + * @memberof proto.HydratedQuickReplyButton + * @static + * @param {proto.IHydratedQuickReplyButton=} [properties] Properties to set + * @returns {proto.HydratedQuickReplyButton} HydratedQuickReplyButton instance + */ + HydratedQuickReplyButton.create = function create(properties) { + return new HydratedQuickReplyButton(properties); + }; + + /** + * Encodes the specified HydratedQuickReplyButton message. Does not implicitly {@link proto.HydratedQuickReplyButton.verify|verify} messages. + * @function encode + * @memberof proto.HydratedQuickReplyButton + * @static + * @param {proto.IHydratedQuickReplyButton} message HydratedQuickReplyButton message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HydratedQuickReplyButton.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.displayText != null && Object.hasOwnProperty.call(message, "displayText")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayText); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.id); + return writer; + }; + + /** + * Encodes the specified HydratedQuickReplyButton message, length delimited. Does not implicitly {@link proto.HydratedQuickReplyButton.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.HydratedQuickReplyButton + * @static + * @param {proto.IHydratedQuickReplyButton} message HydratedQuickReplyButton message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HydratedQuickReplyButton.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HydratedQuickReplyButton message from the specified reader or buffer. + * @function decode + * @memberof proto.HydratedQuickReplyButton + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.HydratedQuickReplyButton} HydratedQuickReplyButton + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HydratedQuickReplyButton.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.HydratedQuickReplyButton(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.displayText = reader.string(); + break; + case 2: + message.id = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HydratedQuickReplyButton message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.HydratedQuickReplyButton + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.HydratedQuickReplyButton} HydratedQuickReplyButton + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HydratedQuickReplyButton.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HydratedQuickReplyButton message. + * @function verify + * @memberof proto.HydratedQuickReplyButton + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HydratedQuickReplyButton.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.displayText != null && message.hasOwnProperty("displayText")) + if (!$util.isString(message.displayText)) + return "displayText: string expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + return null; + }; + + /** + * Creates a HydratedQuickReplyButton message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.HydratedQuickReplyButton + * @static + * @param {Object.} object Plain object + * @returns {proto.HydratedQuickReplyButton} HydratedQuickReplyButton + */ + HydratedQuickReplyButton.fromObject = function fromObject(object) { + if (object instanceof $root.proto.HydratedQuickReplyButton) + return object; + var message = new $root.proto.HydratedQuickReplyButton(); + if (object.displayText != null) + message.displayText = String(object.displayText); + if (object.id != null) + message.id = String(object.id); + return message; + }; + + /** + * Creates a plain object from a HydratedQuickReplyButton message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.HydratedQuickReplyButton + * @static + * @param {proto.HydratedQuickReplyButton} message HydratedQuickReplyButton + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HydratedQuickReplyButton.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.displayText = ""; + object.id = ""; + } + if (message.displayText != null && message.hasOwnProperty("displayText")) + object.displayText = message.displayText; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + return object; + }; + + /** + * Converts this HydratedQuickReplyButton to JSON. + * @function toJSON + * @memberof proto.HydratedQuickReplyButton + * @instance + * @returns {Object.} JSON object + */ + HydratedQuickReplyButton.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return HydratedQuickReplyButton; + })(); + + proto.HydratedURLButton = (function() { + + /** + * Properties of a HydratedURLButton. + * @memberof proto + * @interface IHydratedURLButton + * @property {string|null} [displayText] HydratedURLButton displayText + * @property {string|null} [url] HydratedURLButton url + */ + + /** + * Constructs a new HydratedURLButton. + * @memberof proto + * @classdesc Represents a HydratedURLButton. + * @implements IHydratedURLButton + * @constructor + * @param {proto.IHydratedURLButton=} [properties] Properties to set + */ + function HydratedURLButton(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HydratedURLButton displayText. + * @member {string} displayText + * @memberof proto.HydratedURLButton + * @instance + */ + HydratedURLButton.prototype.displayText = ""; + + /** + * HydratedURLButton url. + * @member {string} url + * @memberof proto.HydratedURLButton + * @instance + */ + HydratedURLButton.prototype.url = ""; + + /** + * Creates a new HydratedURLButton instance using the specified properties. + * @function create + * @memberof proto.HydratedURLButton + * @static + * @param {proto.IHydratedURLButton=} [properties] Properties to set + * @returns {proto.HydratedURLButton} HydratedURLButton instance + */ + HydratedURLButton.create = function create(properties) { + return new HydratedURLButton(properties); + }; + + /** + * Encodes the specified HydratedURLButton message. Does not implicitly {@link proto.HydratedURLButton.verify|verify} messages. + * @function encode + * @memberof proto.HydratedURLButton + * @static + * @param {proto.IHydratedURLButton} message HydratedURLButton message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HydratedURLButton.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.displayText != null && Object.hasOwnProperty.call(message, "displayText")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayText); + if (message.url != null && Object.hasOwnProperty.call(message, "url")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.url); + return writer; + }; + + /** + * Encodes the specified HydratedURLButton message, length delimited. Does not implicitly {@link proto.HydratedURLButton.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.HydratedURLButton + * @static + * @param {proto.IHydratedURLButton} message HydratedURLButton message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HydratedURLButton.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HydratedURLButton message from the specified reader or buffer. + * @function decode + * @memberof proto.HydratedURLButton + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.HydratedURLButton} HydratedURLButton + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HydratedURLButton.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.HydratedURLButton(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.displayText = reader.string(); + break; + case 2: + message.url = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HydratedURLButton message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.HydratedURLButton + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.HydratedURLButton} HydratedURLButton + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HydratedURLButton.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HydratedURLButton message. + * @function verify + * @memberof proto.HydratedURLButton + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HydratedURLButton.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.displayText != null && message.hasOwnProperty("displayText")) + if (!$util.isString(message.displayText)) + return "displayText: string expected"; + if (message.url != null && message.hasOwnProperty("url")) + if (!$util.isString(message.url)) + return "url: string expected"; + return null; + }; + + /** + * Creates a HydratedURLButton message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.HydratedURLButton + * @static + * @param {Object.} object Plain object + * @returns {proto.HydratedURLButton} HydratedURLButton + */ + HydratedURLButton.fromObject = function fromObject(object) { + if (object instanceof $root.proto.HydratedURLButton) + return object; + var message = new $root.proto.HydratedURLButton(); + if (object.displayText != null) + message.displayText = String(object.displayText); + if (object.url != null) + message.url = String(object.url); + return message; + }; + + /** + * Creates a plain object from a HydratedURLButton message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.HydratedURLButton + * @static + * @param {proto.HydratedURLButton} message HydratedURLButton + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HydratedURLButton.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.displayText = ""; + object.url = ""; + } + if (message.displayText != null && message.hasOwnProperty("displayText")) + object.displayText = message.displayText; + if (message.url != null && message.hasOwnProperty("url")) + object.url = message.url; + return object; + }; + + /** + * Converts this HydratedURLButton to JSON. + * @function toJSON + * @memberof proto.HydratedURLButton + * @instance + * @returns {Object.} JSON object + */ + HydratedURLButton.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return HydratedURLButton; + })(); + + proto.HydratedCallButton = (function() { + + /** + * Properties of a HydratedCallButton. + * @memberof proto + * @interface IHydratedCallButton + * @property {string|null} [displayText] HydratedCallButton displayText + * @property {string|null} [phoneNumber] HydratedCallButton phoneNumber + */ + + /** + * Constructs a new HydratedCallButton. + * @memberof proto + * @classdesc Represents a HydratedCallButton. + * @implements IHydratedCallButton + * @constructor + * @param {proto.IHydratedCallButton=} [properties] Properties to set + */ + function HydratedCallButton(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HydratedCallButton displayText. + * @member {string} displayText + * @memberof proto.HydratedCallButton + * @instance + */ + HydratedCallButton.prototype.displayText = ""; + + /** + * HydratedCallButton phoneNumber. + * @member {string} phoneNumber + * @memberof proto.HydratedCallButton + * @instance + */ + HydratedCallButton.prototype.phoneNumber = ""; + + /** + * Creates a new HydratedCallButton instance using the specified properties. + * @function create + * @memberof proto.HydratedCallButton + * @static + * @param {proto.IHydratedCallButton=} [properties] Properties to set + * @returns {proto.HydratedCallButton} HydratedCallButton instance + */ + HydratedCallButton.create = function create(properties) { + return new HydratedCallButton(properties); + }; + + /** + * Encodes the specified HydratedCallButton message. Does not implicitly {@link proto.HydratedCallButton.verify|verify} messages. + * @function encode + * @memberof proto.HydratedCallButton + * @static + * @param {proto.IHydratedCallButton} message HydratedCallButton message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HydratedCallButton.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.displayText != null && Object.hasOwnProperty.call(message, "displayText")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayText); + if (message.phoneNumber != null && Object.hasOwnProperty.call(message, "phoneNumber")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.phoneNumber); + return writer; + }; + + /** + * Encodes the specified HydratedCallButton message, length delimited. Does not implicitly {@link proto.HydratedCallButton.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.HydratedCallButton + * @static + * @param {proto.IHydratedCallButton} message HydratedCallButton message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HydratedCallButton.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HydratedCallButton message from the specified reader or buffer. + * @function decode + * @memberof proto.HydratedCallButton + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.HydratedCallButton} HydratedCallButton + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HydratedCallButton.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.HydratedCallButton(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.displayText = reader.string(); + break; + case 2: + message.phoneNumber = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HydratedCallButton message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.HydratedCallButton + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.HydratedCallButton} HydratedCallButton + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HydratedCallButton.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HydratedCallButton message. + * @function verify + * @memberof proto.HydratedCallButton + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HydratedCallButton.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.displayText != null && message.hasOwnProperty("displayText")) + if (!$util.isString(message.displayText)) + return "displayText: string expected"; + if (message.phoneNumber != null && message.hasOwnProperty("phoneNumber")) + if (!$util.isString(message.phoneNumber)) + return "phoneNumber: string expected"; + return null; + }; + + /** + * Creates a HydratedCallButton message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.HydratedCallButton + * @static + * @param {Object.} object Plain object + * @returns {proto.HydratedCallButton} HydratedCallButton + */ + HydratedCallButton.fromObject = function fromObject(object) { + if (object instanceof $root.proto.HydratedCallButton) + return object; + var message = new $root.proto.HydratedCallButton(); + if (object.displayText != null) + message.displayText = String(object.displayText); + if (object.phoneNumber != null) + message.phoneNumber = String(object.phoneNumber); + return message; + }; + + /** + * Creates a plain object from a HydratedCallButton message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.HydratedCallButton + * @static + * @param {proto.HydratedCallButton} message HydratedCallButton + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HydratedCallButton.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.displayText = ""; + object.phoneNumber = ""; + } + if (message.displayText != null && message.hasOwnProperty("displayText")) + object.displayText = message.displayText; + if (message.phoneNumber != null && message.hasOwnProperty("phoneNumber")) + object.phoneNumber = message.phoneNumber; + return object; + }; + + /** + * Converts this HydratedCallButton to JSON. + * @function toJSON + * @memberof proto.HydratedCallButton + * @instance + * @returns {Object.} JSON object + */ + HydratedCallButton.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return HydratedCallButton; + })(); + + proto.HydratedTemplateButton = (function() { + + /** + * Properties of a HydratedTemplateButton. + * @memberof proto + * @interface IHydratedTemplateButton + * @property {number|null} [index] HydratedTemplateButton index + * @property {proto.IHydratedQuickReplyButton|null} [quickReplyButton] HydratedTemplateButton quickReplyButton + * @property {proto.IHydratedURLButton|null} [urlButton] HydratedTemplateButton urlButton + * @property {proto.IHydratedCallButton|null} [callButton] HydratedTemplateButton callButton + */ + + /** + * Constructs a new HydratedTemplateButton. + * @memberof proto + * @classdesc Represents a HydratedTemplateButton. + * @implements IHydratedTemplateButton + * @constructor + * @param {proto.IHydratedTemplateButton=} [properties] Properties to set + */ + function HydratedTemplateButton(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HydratedTemplateButton index. + * @member {number} index + * @memberof proto.HydratedTemplateButton + * @instance + */ + HydratedTemplateButton.prototype.index = 0; + + /** + * HydratedTemplateButton quickReplyButton. + * @member {proto.IHydratedQuickReplyButton|null|undefined} quickReplyButton + * @memberof proto.HydratedTemplateButton + * @instance + */ + HydratedTemplateButton.prototype.quickReplyButton = null; + + /** + * HydratedTemplateButton urlButton. + * @member {proto.IHydratedURLButton|null|undefined} urlButton + * @memberof proto.HydratedTemplateButton + * @instance + */ + HydratedTemplateButton.prototype.urlButton = null; + + /** + * HydratedTemplateButton callButton. + * @member {proto.IHydratedCallButton|null|undefined} callButton + * @memberof proto.HydratedTemplateButton + * @instance + */ + HydratedTemplateButton.prototype.callButton = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HydratedTemplateButton hydratedButton. + * @member {"quickReplyButton"|"urlButton"|"callButton"|undefined} hydratedButton + * @memberof proto.HydratedTemplateButton + * @instance + */ + Object.defineProperty(HydratedTemplateButton.prototype, "hydratedButton", { + get: $util.oneOfGetter($oneOfFields = ["quickReplyButton", "urlButton", "callButton"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HydratedTemplateButton instance using the specified properties. + * @function create + * @memberof proto.HydratedTemplateButton + * @static + * @param {proto.IHydratedTemplateButton=} [properties] Properties to set + * @returns {proto.HydratedTemplateButton} HydratedTemplateButton instance + */ + HydratedTemplateButton.create = function create(properties) { + return new HydratedTemplateButton(properties); + }; + + /** + * Encodes the specified HydratedTemplateButton message. Does not implicitly {@link proto.HydratedTemplateButton.verify|verify} messages. + * @function encode + * @memberof proto.HydratedTemplateButton + * @static + * @param {proto.IHydratedTemplateButton} message HydratedTemplateButton message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HydratedTemplateButton.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.quickReplyButton != null && Object.hasOwnProperty.call(message, "quickReplyButton")) + $root.proto.HydratedQuickReplyButton.encode(message.quickReplyButton, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.urlButton != null && Object.hasOwnProperty.call(message, "urlButton")) + $root.proto.HydratedURLButton.encode(message.urlButton, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.callButton != null && Object.hasOwnProperty.call(message, "callButton")) + $root.proto.HydratedCallButton.encode(message.callButton, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.index); + return writer; + }; + + /** + * Encodes the specified HydratedTemplateButton message, length delimited. Does not implicitly {@link proto.HydratedTemplateButton.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.HydratedTemplateButton + * @static + * @param {proto.IHydratedTemplateButton} message HydratedTemplateButton message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HydratedTemplateButton.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HydratedTemplateButton message from the specified reader or buffer. + * @function decode + * @memberof proto.HydratedTemplateButton + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.HydratedTemplateButton} HydratedTemplateButton + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HydratedTemplateButton.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.HydratedTemplateButton(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: + message.index = reader.uint32(); + break; + case 1: + message.quickReplyButton = $root.proto.HydratedQuickReplyButton.decode(reader, reader.uint32()); + break; + case 2: + message.urlButton = $root.proto.HydratedURLButton.decode(reader, reader.uint32()); + break; + case 3: + message.callButton = $root.proto.HydratedCallButton.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HydratedTemplateButton message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.HydratedTemplateButton + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.HydratedTemplateButton} HydratedTemplateButton + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HydratedTemplateButton.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HydratedTemplateButton message. + * @function verify + * @memberof proto.HydratedTemplateButton + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HydratedTemplateButton.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.index != null && message.hasOwnProperty("index")) + if (!$util.isInteger(message.index)) + return "index: integer expected"; + if (message.quickReplyButton != null && message.hasOwnProperty("quickReplyButton")) { + properties.hydratedButton = 1; + { + var error = $root.proto.HydratedQuickReplyButton.verify(message.quickReplyButton); + if (error) + return "quickReplyButton." + error; + } + } + if (message.urlButton != null && message.hasOwnProperty("urlButton")) { + if (properties.hydratedButton === 1) + return "hydratedButton: multiple values"; + properties.hydratedButton = 1; + { + var error = $root.proto.HydratedURLButton.verify(message.urlButton); + if (error) + return "urlButton." + error; + } + } + if (message.callButton != null && message.hasOwnProperty("callButton")) { + if (properties.hydratedButton === 1) + return "hydratedButton: multiple values"; + properties.hydratedButton = 1; + { + var error = $root.proto.HydratedCallButton.verify(message.callButton); + if (error) + return "callButton." + error; + } + } + return null; + }; + + /** + * Creates a HydratedTemplateButton message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.HydratedTemplateButton + * @static + * @param {Object.} object Plain object + * @returns {proto.HydratedTemplateButton} HydratedTemplateButton + */ + HydratedTemplateButton.fromObject = function fromObject(object) { + if (object instanceof $root.proto.HydratedTemplateButton) + return object; + var message = new $root.proto.HydratedTemplateButton(); + if (object.index != null) + message.index = object.index >>> 0; + if (object.quickReplyButton != null) { + if (typeof object.quickReplyButton !== "object") + throw TypeError(".proto.HydratedTemplateButton.quickReplyButton: object expected"); + message.quickReplyButton = $root.proto.HydratedQuickReplyButton.fromObject(object.quickReplyButton); + } + if (object.urlButton != null) { + if (typeof object.urlButton !== "object") + throw TypeError(".proto.HydratedTemplateButton.urlButton: object expected"); + message.urlButton = $root.proto.HydratedURLButton.fromObject(object.urlButton); + } + if (object.callButton != null) { + if (typeof object.callButton !== "object") + throw TypeError(".proto.HydratedTemplateButton.callButton: object expected"); + message.callButton = $root.proto.HydratedCallButton.fromObject(object.callButton); + } + return message; + }; + + /** + * Creates a plain object from a HydratedTemplateButton message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.HydratedTemplateButton + * @static + * @param {proto.HydratedTemplateButton} message HydratedTemplateButton + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HydratedTemplateButton.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.index = 0; + if (message.quickReplyButton != null && message.hasOwnProperty("quickReplyButton")) { + object.quickReplyButton = $root.proto.HydratedQuickReplyButton.toObject(message.quickReplyButton, options); + if (options.oneofs) + object.hydratedButton = "quickReplyButton"; + } + if (message.urlButton != null && message.hasOwnProperty("urlButton")) { + object.urlButton = $root.proto.HydratedURLButton.toObject(message.urlButton, options); + if (options.oneofs) + object.hydratedButton = "urlButton"; + } + if (message.callButton != null && message.hasOwnProperty("callButton")) { + object.callButton = $root.proto.HydratedCallButton.toObject(message.callButton, options); + if (options.oneofs) + object.hydratedButton = "callButton"; + } + if (message.index != null && message.hasOwnProperty("index")) + object.index = message.index; + return object; + }; + + /** + * Converts this HydratedTemplateButton to JSON. + * @function toJSON + * @memberof proto.HydratedTemplateButton + * @instance + * @returns {Object.} JSON object + */ + HydratedTemplateButton.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return HydratedTemplateButton; + })(); + + proto.QuickReplyButton = (function() { + + /** + * Properties of a QuickReplyButton. + * @memberof proto + * @interface IQuickReplyButton + * @property {proto.IHighlyStructuredMessage|null} [displayText] QuickReplyButton displayText + * @property {string|null} [id] QuickReplyButton id + */ + + /** + * Constructs a new QuickReplyButton. + * @memberof proto + * @classdesc Represents a QuickReplyButton. + * @implements IQuickReplyButton + * @constructor + * @param {proto.IQuickReplyButton=} [properties] Properties to set + */ + function QuickReplyButton(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QuickReplyButton displayText. + * @member {proto.IHighlyStructuredMessage|null|undefined} displayText + * @memberof proto.QuickReplyButton + * @instance + */ + QuickReplyButton.prototype.displayText = null; + + /** + * QuickReplyButton id. + * @member {string} id + * @memberof proto.QuickReplyButton + * @instance + */ + QuickReplyButton.prototype.id = ""; + + /** + * Creates a new QuickReplyButton instance using the specified properties. + * @function create + * @memberof proto.QuickReplyButton + * @static + * @param {proto.IQuickReplyButton=} [properties] Properties to set + * @returns {proto.QuickReplyButton} QuickReplyButton instance + */ + QuickReplyButton.create = function create(properties) { + return new QuickReplyButton(properties); + }; + + /** + * Encodes the specified QuickReplyButton message. Does not implicitly {@link proto.QuickReplyButton.verify|verify} messages. + * @function encode + * @memberof proto.QuickReplyButton + * @static + * @param {proto.IQuickReplyButton} message QuickReplyButton message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuickReplyButton.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.displayText != null && Object.hasOwnProperty.call(message, "displayText")) + $root.proto.HighlyStructuredMessage.encode(message.displayText, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.id); + return writer; + }; + + /** + * Encodes the specified QuickReplyButton message, length delimited. Does not implicitly {@link proto.QuickReplyButton.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.QuickReplyButton + * @static + * @param {proto.IQuickReplyButton} message QuickReplyButton message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuickReplyButton.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QuickReplyButton message from the specified reader or buffer. + * @function decode + * @memberof proto.QuickReplyButton + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.QuickReplyButton} QuickReplyButton + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuickReplyButton.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.QuickReplyButton(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.displayText = $root.proto.HighlyStructuredMessage.decode(reader, reader.uint32()); + break; + case 2: + message.id = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QuickReplyButton message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.QuickReplyButton + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.QuickReplyButton} QuickReplyButton + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuickReplyButton.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QuickReplyButton message. + * @function verify + * @memberof proto.QuickReplyButton + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QuickReplyButton.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.displayText != null && message.hasOwnProperty("displayText")) { + var error = $root.proto.HighlyStructuredMessage.verify(message.displayText); + if (error) + return "displayText." + error; + } + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + return null; + }; + + /** + * Creates a QuickReplyButton message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.QuickReplyButton + * @static + * @param {Object.} object Plain object + * @returns {proto.QuickReplyButton} QuickReplyButton + */ + QuickReplyButton.fromObject = function fromObject(object) { + if (object instanceof $root.proto.QuickReplyButton) + return object; + var message = new $root.proto.QuickReplyButton(); + if (object.displayText != null) { + if (typeof object.displayText !== "object") + throw TypeError(".proto.QuickReplyButton.displayText: object expected"); + message.displayText = $root.proto.HighlyStructuredMessage.fromObject(object.displayText); + } + if (object.id != null) + message.id = String(object.id); + return message; + }; + + /** + * Creates a plain object from a QuickReplyButton message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.QuickReplyButton + * @static + * @param {proto.QuickReplyButton} message QuickReplyButton + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QuickReplyButton.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.displayText = null; + object.id = ""; + } + if (message.displayText != null && message.hasOwnProperty("displayText")) + object.displayText = $root.proto.HighlyStructuredMessage.toObject(message.displayText, options); + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + return object; + }; + + /** + * Converts this QuickReplyButton to JSON. + * @function toJSON + * @memberof proto.QuickReplyButton + * @instance + * @returns {Object.} JSON object + */ + QuickReplyButton.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QuickReplyButton; + })(); + + proto.URLButton = (function() { + + /** + * Properties of a URLButton. + * @memberof proto + * @interface IURLButton + * @property {proto.IHighlyStructuredMessage|null} [displayText] URLButton displayText + * @property {proto.IHighlyStructuredMessage|null} [url] URLButton url + */ + + /** + * Constructs a new URLButton. + * @memberof proto + * @classdesc Represents a URLButton. + * @implements IURLButton + * @constructor + * @param {proto.IURLButton=} [properties] Properties to set + */ + function URLButton(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * URLButton displayText. + * @member {proto.IHighlyStructuredMessage|null|undefined} displayText + * @memberof proto.URLButton + * @instance + */ + URLButton.prototype.displayText = null; + + /** + * URLButton url. + * @member {proto.IHighlyStructuredMessage|null|undefined} url + * @memberof proto.URLButton + * @instance + */ + URLButton.prototype.url = null; + + /** + * Creates a new URLButton instance using the specified properties. + * @function create + * @memberof proto.URLButton + * @static + * @param {proto.IURLButton=} [properties] Properties to set + * @returns {proto.URLButton} URLButton instance + */ + URLButton.create = function create(properties) { + return new URLButton(properties); + }; + + /** + * Encodes the specified URLButton message. Does not implicitly {@link proto.URLButton.verify|verify} messages. + * @function encode + * @memberof proto.URLButton + * @static + * @param {proto.IURLButton} message URLButton message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + URLButton.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.displayText != null && Object.hasOwnProperty.call(message, "displayText")) + $root.proto.HighlyStructuredMessage.encode(message.displayText, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.url != null && Object.hasOwnProperty.call(message, "url")) + $root.proto.HighlyStructuredMessage.encode(message.url, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified URLButton message, length delimited. Does not implicitly {@link proto.URLButton.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.URLButton + * @static + * @param {proto.IURLButton} message URLButton message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + URLButton.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a URLButton message from the specified reader or buffer. + * @function decode + * @memberof proto.URLButton + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.URLButton} URLButton + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + URLButton.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.URLButton(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.displayText = $root.proto.HighlyStructuredMessage.decode(reader, reader.uint32()); + break; + case 2: + message.url = $root.proto.HighlyStructuredMessage.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a URLButton message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.URLButton + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.URLButton} URLButton + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + URLButton.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a URLButton message. + * @function verify + * @memberof proto.URLButton + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + URLButton.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.displayText != null && message.hasOwnProperty("displayText")) { + var error = $root.proto.HighlyStructuredMessage.verify(message.displayText); + if (error) + return "displayText." + error; + } + if (message.url != null && message.hasOwnProperty("url")) { + var error = $root.proto.HighlyStructuredMessage.verify(message.url); + if (error) + return "url." + error; + } + return null; + }; + + /** + * Creates a URLButton message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.URLButton + * @static + * @param {Object.} object Plain object + * @returns {proto.URLButton} URLButton + */ + URLButton.fromObject = function fromObject(object) { + if (object instanceof $root.proto.URLButton) + return object; + var message = new $root.proto.URLButton(); + if (object.displayText != null) { + if (typeof object.displayText !== "object") + throw TypeError(".proto.URLButton.displayText: object expected"); + message.displayText = $root.proto.HighlyStructuredMessage.fromObject(object.displayText); + } + if (object.url != null) { + if (typeof object.url !== "object") + throw TypeError(".proto.URLButton.url: object expected"); + message.url = $root.proto.HighlyStructuredMessage.fromObject(object.url); + } + return message; + }; + + /** + * Creates a plain object from a URLButton message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.URLButton + * @static + * @param {proto.URLButton} message URLButton + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + URLButton.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.displayText = null; + object.url = null; + } + if (message.displayText != null && message.hasOwnProperty("displayText")) + object.displayText = $root.proto.HighlyStructuredMessage.toObject(message.displayText, options); + if (message.url != null && message.hasOwnProperty("url")) + object.url = $root.proto.HighlyStructuredMessage.toObject(message.url, options); + return object; + }; + + /** + * Converts this URLButton to JSON. + * @function toJSON + * @memberof proto.URLButton + * @instance + * @returns {Object.} JSON object + */ + URLButton.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return URLButton; + })(); + + proto.CallButton = (function() { + + /** + * Properties of a CallButton. + * @memberof proto + * @interface ICallButton + * @property {proto.IHighlyStructuredMessage|null} [displayText] CallButton displayText + * @property {proto.IHighlyStructuredMessage|null} [phoneNumber] CallButton phoneNumber + */ + + /** + * Constructs a new CallButton. + * @memberof proto + * @classdesc Represents a CallButton. + * @implements ICallButton + * @constructor + * @param {proto.ICallButton=} [properties] Properties to set + */ + function CallButton(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CallButton displayText. + * @member {proto.IHighlyStructuredMessage|null|undefined} displayText + * @memberof proto.CallButton + * @instance + */ + CallButton.prototype.displayText = null; + + /** + * CallButton phoneNumber. + * @member {proto.IHighlyStructuredMessage|null|undefined} phoneNumber + * @memberof proto.CallButton + * @instance + */ + CallButton.prototype.phoneNumber = null; + + /** + * Creates a new CallButton instance using the specified properties. + * @function create + * @memberof proto.CallButton + * @static + * @param {proto.ICallButton=} [properties] Properties to set + * @returns {proto.CallButton} CallButton instance + */ + CallButton.create = function create(properties) { + return new CallButton(properties); + }; + + /** + * Encodes the specified CallButton message. Does not implicitly {@link proto.CallButton.verify|verify} messages. + * @function encode + * @memberof proto.CallButton + * @static + * @param {proto.ICallButton} message CallButton message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CallButton.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.displayText != null && Object.hasOwnProperty.call(message, "displayText")) + $root.proto.HighlyStructuredMessage.encode(message.displayText, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.phoneNumber != null && Object.hasOwnProperty.call(message, "phoneNumber")) + $root.proto.HighlyStructuredMessage.encode(message.phoneNumber, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CallButton message, length delimited. Does not implicitly {@link proto.CallButton.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.CallButton + * @static + * @param {proto.ICallButton} message CallButton message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CallButton.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CallButton message from the specified reader or buffer. + * @function decode + * @memberof proto.CallButton + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.CallButton} CallButton + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CallButton.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.CallButton(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.displayText = $root.proto.HighlyStructuredMessage.decode(reader, reader.uint32()); + break; + case 2: + message.phoneNumber = $root.proto.HighlyStructuredMessage.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CallButton message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.CallButton + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.CallButton} CallButton + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CallButton.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CallButton message. + * @function verify + * @memberof proto.CallButton + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CallButton.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.displayText != null && message.hasOwnProperty("displayText")) { + var error = $root.proto.HighlyStructuredMessage.verify(message.displayText); + if (error) + return "displayText." + error; + } + if (message.phoneNumber != null && message.hasOwnProperty("phoneNumber")) { + var error = $root.proto.HighlyStructuredMessage.verify(message.phoneNumber); + if (error) + return "phoneNumber." + error; + } + return null; + }; + + /** + * Creates a CallButton message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.CallButton + * @static + * @param {Object.} object Plain object + * @returns {proto.CallButton} CallButton + */ + CallButton.fromObject = function fromObject(object) { + if (object instanceof $root.proto.CallButton) + return object; + var message = new $root.proto.CallButton(); + if (object.displayText != null) { + if (typeof object.displayText !== "object") + throw TypeError(".proto.CallButton.displayText: object expected"); + message.displayText = $root.proto.HighlyStructuredMessage.fromObject(object.displayText); + } + if (object.phoneNumber != null) { + if (typeof object.phoneNumber !== "object") + throw TypeError(".proto.CallButton.phoneNumber: object expected"); + message.phoneNumber = $root.proto.HighlyStructuredMessage.fromObject(object.phoneNumber); + } + return message; + }; + + /** + * Creates a plain object from a CallButton message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.CallButton + * @static + * @param {proto.CallButton} message CallButton + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CallButton.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.displayText = null; + object.phoneNumber = null; + } + if (message.displayText != null && message.hasOwnProperty("displayText")) + object.displayText = $root.proto.HighlyStructuredMessage.toObject(message.displayText, options); + if (message.phoneNumber != null && message.hasOwnProperty("phoneNumber")) + object.phoneNumber = $root.proto.HighlyStructuredMessage.toObject(message.phoneNumber, options); + return object; + }; + + /** + * Converts this CallButton to JSON. + * @function toJSON + * @memberof proto.CallButton + * @instance + * @returns {Object.} JSON object + */ + CallButton.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CallButton; + })(); + + proto.TemplateButton = (function() { + + /** + * Properties of a TemplateButton. + * @memberof proto + * @interface ITemplateButton + * @property {number|null} [index] TemplateButton index + * @property {proto.IQuickReplyButton|null} [quickReplyButton] TemplateButton quickReplyButton + * @property {proto.IURLButton|null} [urlButton] TemplateButton urlButton + * @property {proto.ICallButton|null} [callButton] TemplateButton callButton + */ + + /** + * Constructs a new TemplateButton. + * @memberof proto + * @classdesc Represents a TemplateButton. + * @implements ITemplateButton + * @constructor + * @param {proto.ITemplateButton=} [properties] Properties to set + */ + function TemplateButton(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TemplateButton index. + * @member {number} index + * @memberof proto.TemplateButton + * @instance + */ + TemplateButton.prototype.index = 0; + + /** + * TemplateButton quickReplyButton. + * @member {proto.IQuickReplyButton|null|undefined} quickReplyButton + * @memberof proto.TemplateButton + * @instance + */ + TemplateButton.prototype.quickReplyButton = null; + + /** + * TemplateButton urlButton. + * @member {proto.IURLButton|null|undefined} urlButton + * @memberof proto.TemplateButton + * @instance + */ + TemplateButton.prototype.urlButton = null; + + /** + * TemplateButton callButton. + * @member {proto.ICallButton|null|undefined} callButton + * @memberof proto.TemplateButton + * @instance + */ + TemplateButton.prototype.callButton = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TemplateButton button. + * @member {"quickReplyButton"|"urlButton"|"callButton"|undefined} button + * @memberof proto.TemplateButton + * @instance + */ + Object.defineProperty(TemplateButton.prototype, "button", { + get: $util.oneOfGetter($oneOfFields = ["quickReplyButton", "urlButton", "callButton"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TemplateButton instance using the specified properties. + * @function create + * @memberof proto.TemplateButton + * @static + * @param {proto.ITemplateButton=} [properties] Properties to set + * @returns {proto.TemplateButton} TemplateButton instance + */ + TemplateButton.create = function create(properties) { + return new TemplateButton(properties); + }; + + /** + * Encodes the specified TemplateButton message. Does not implicitly {@link proto.TemplateButton.verify|verify} messages. + * @function encode + * @memberof proto.TemplateButton + * @static + * @param {proto.ITemplateButton} message TemplateButton message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TemplateButton.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.quickReplyButton != null && Object.hasOwnProperty.call(message, "quickReplyButton")) + $root.proto.QuickReplyButton.encode(message.quickReplyButton, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.urlButton != null && Object.hasOwnProperty.call(message, "urlButton")) + $root.proto.URLButton.encode(message.urlButton, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.callButton != null && Object.hasOwnProperty.call(message, "callButton")) + $root.proto.CallButton.encode(message.callButton, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.index); + return writer; + }; + + /** + * Encodes the specified TemplateButton message, length delimited. Does not implicitly {@link proto.TemplateButton.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.TemplateButton + * @static + * @param {proto.ITemplateButton} message TemplateButton message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TemplateButton.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TemplateButton message from the specified reader or buffer. + * @function decode + * @memberof proto.TemplateButton + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.TemplateButton} TemplateButton + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TemplateButton.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.TemplateButton(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: + message.index = reader.uint32(); + break; + case 1: + message.quickReplyButton = $root.proto.QuickReplyButton.decode(reader, reader.uint32()); + break; + case 2: + message.urlButton = $root.proto.URLButton.decode(reader, reader.uint32()); + break; + case 3: + message.callButton = $root.proto.CallButton.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TemplateButton message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.TemplateButton + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.TemplateButton} TemplateButton + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TemplateButton.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TemplateButton message. + * @function verify + * @memberof proto.TemplateButton + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TemplateButton.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.index != null && message.hasOwnProperty("index")) + if (!$util.isInteger(message.index)) + return "index: integer expected"; + if (message.quickReplyButton != null && message.hasOwnProperty("quickReplyButton")) { + properties.button = 1; + { + var error = $root.proto.QuickReplyButton.verify(message.quickReplyButton); + if (error) + return "quickReplyButton." + error; + } + } + if (message.urlButton != null && message.hasOwnProperty("urlButton")) { + if (properties.button === 1) + return "button: multiple values"; + properties.button = 1; + { + var error = $root.proto.URLButton.verify(message.urlButton); + if (error) + return "urlButton." + error; + } + } + if (message.callButton != null && message.hasOwnProperty("callButton")) { + if (properties.button === 1) + return "button: multiple values"; + properties.button = 1; + { + var error = $root.proto.CallButton.verify(message.callButton); + if (error) + return "callButton." + error; + } + } + return null; + }; + + /** + * Creates a TemplateButton message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.TemplateButton + * @static + * @param {Object.} object Plain object + * @returns {proto.TemplateButton} TemplateButton + */ + TemplateButton.fromObject = function fromObject(object) { + if (object instanceof $root.proto.TemplateButton) + return object; + var message = new $root.proto.TemplateButton(); + if (object.index != null) + message.index = object.index >>> 0; + if (object.quickReplyButton != null) { + if (typeof object.quickReplyButton !== "object") + throw TypeError(".proto.TemplateButton.quickReplyButton: object expected"); + message.quickReplyButton = $root.proto.QuickReplyButton.fromObject(object.quickReplyButton); + } + if (object.urlButton != null) { + if (typeof object.urlButton !== "object") + throw TypeError(".proto.TemplateButton.urlButton: object expected"); + message.urlButton = $root.proto.URLButton.fromObject(object.urlButton); + } + if (object.callButton != null) { + if (typeof object.callButton !== "object") + throw TypeError(".proto.TemplateButton.callButton: object expected"); + message.callButton = $root.proto.CallButton.fromObject(object.callButton); + } + return message; + }; + + /** + * Creates a plain object from a TemplateButton message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.TemplateButton + * @static + * @param {proto.TemplateButton} message TemplateButton + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TemplateButton.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.index = 0; + if (message.quickReplyButton != null && message.hasOwnProperty("quickReplyButton")) { + object.quickReplyButton = $root.proto.QuickReplyButton.toObject(message.quickReplyButton, options); + if (options.oneofs) + object.button = "quickReplyButton"; + } + if (message.urlButton != null && message.hasOwnProperty("urlButton")) { + object.urlButton = $root.proto.URLButton.toObject(message.urlButton, options); + if (options.oneofs) + object.button = "urlButton"; + } + if (message.callButton != null && message.hasOwnProperty("callButton")) { + object.callButton = $root.proto.CallButton.toObject(message.callButton, options); + if (options.oneofs) + object.button = "callButton"; + } + if (message.index != null && message.hasOwnProperty("index")) + object.index = message.index; + return object; + }; + + /** + * Converts this TemplateButton to JSON. + * @function toJSON + * @memberof proto.TemplateButton + * @instance + * @returns {Object.} JSON object + */ + TemplateButton.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TemplateButton; + })(); + + proto.Location = (function() { + + /** + * Properties of a Location. + * @memberof proto + * @interface ILocation + * @property {number|null} [degreesLatitude] Location degreesLatitude + * @property {number|null} [degreesLongitude] Location degreesLongitude + * @property {string|null} [name] Location name + */ + + /** + * Constructs a new Location. + * @memberof proto + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {proto.ILocation=} [properties] Properties to set + */ + function Location(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Location degreesLatitude. + * @member {number} degreesLatitude + * @memberof proto.Location + * @instance + */ + Location.prototype.degreesLatitude = 0; + + /** + * Location degreesLongitude. + * @member {number} degreesLongitude + * @memberof proto.Location + * @instance + */ + Location.prototype.degreesLongitude = 0; + + /** + * Location name. + * @member {string} name + * @memberof proto.Location + * @instance + */ + Location.prototype.name = ""; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof proto.Location + * @static + * @param {proto.ILocation=} [properties] Properties to set + * @returns {proto.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link proto.Location.verify|verify} messages. + * @function encode + * @memberof proto.Location + * @static + * @param {proto.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.degreesLatitude != null && Object.hasOwnProperty.call(message, "degreesLatitude")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.degreesLatitude); + if (message.degreesLongitude != null && Object.hasOwnProperty.call(message, "degreesLongitude")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.degreesLongitude); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link proto.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.Location + * @static + * @param {proto.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof proto.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.degreesLatitude = reader.double(); + break; + case 2: + message.degreesLongitude = reader.double(); + break; + case 3: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof proto.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.degreesLatitude != null && message.hasOwnProperty("degreesLatitude")) + if (typeof message.degreesLatitude !== "number") + return "degreesLatitude: number expected"; + if (message.degreesLongitude != null && message.hasOwnProperty("degreesLongitude")) + if (typeof message.degreesLongitude !== "number") + return "degreesLongitude: number expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.Location + * @static + * @param {Object.} object Plain object + * @returns {proto.Location} Location + */ + Location.fromObject = function fromObject(object) { + if (object instanceof $root.proto.Location) + return object; + var message = new $root.proto.Location(); + if (object.degreesLatitude != null) + message.degreesLatitude = Number(object.degreesLatitude); + if (object.degreesLongitude != null) + message.degreesLongitude = Number(object.degreesLongitude); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.Location + * @static + * @param {proto.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.degreesLatitude = 0; + object.degreesLongitude = 0; + object.name = ""; + } + if (message.degreesLatitude != null && message.hasOwnProperty("degreesLatitude")) + object.degreesLatitude = options.json && !isFinite(message.degreesLatitude) ? String(message.degreesLatitude) : message.degreesLatitude; + if (message.degreesLongitude != null && message.hasOwnProperty("degreesLongitude")) + object.degreesLongitude = options.json && !isFinite(message.degreesLongitude) ? String(message.degreesLongitude) : message.degreesLongitude; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof proto.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Location; + })(); + + proto.Point = (function() { + + /** + * Properties of a Point. + * @memberof proto + * @interface IPoint + * @property {number|null} [x] Point x + * @property {number|null} [y] Point y + */ + + /** + * Constructs a new Point. + * @memberof proto + * @classdesc Represents a Point. + * @implements IPoint + * @constructor + * @param {proto.IPoint=} [properties] Properties to set + */ + function Point(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Point x. + * @member {number} x + * @memberof proto.Point + * @instance + */ + Point.prototype.x = 0; + + /** + * Point y. + * @member {number} y + * @memberof proto.Point + * @instance + */ + Point.prototype.y = 0; + + /** + * Creates a new Point instance using the specified properties. + * @function create + * @memberof proto.Point + * @static + * @param {proto.IPoint=} [properties] Properties to set + * @returns {proto.Point} Point instance + */ + Point.create = function create(properties) { + return new Point(properties); + }; + + /** + * Encodes the specified Point message. Does not implicitly {@link proto.Point.verify|verify} messages. + * @function encode + * @memberof proto.Point + * @static + * @param {proto.IPoint} message Point message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Point.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.x != null && Object.hasOwnProperty.call(message, "x")) + writer.uint32(/* id 3, wireType 1 =*/25).double(message.x); + if (message.y != null && Object.hasOwnProperty.call(message, "y")) + writer.uint32(/* id 4, wireType 1 =*/33).double(message.y); + return writer; + }; + + /** + * Encodes the specified Point message, length delimited. Does not implicitly {@link proto.Point.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.Point + * @static + * @param {proto.IPoint} message Point message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Point.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Point message from the specified reader or buffer. + * @function decode + * @memberof proto.Point + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.Point} Point + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Point.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.Point(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: + message.x = reader.double(); + break; + case 4: + message.y = reader.double(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Point message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.Point + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.Point} Point + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Point.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Point message. + * @function verify + * @memberof proto.Point + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Point.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.x != null && message.hasOwnProperty("x")) + if (typeof message.x !== "number") + return "x: number expected"; + if (message.y != null && message.hasOwnProperty("y")) + if (typeof message.y !== "number") + return "y: number expected"; + return null; + }; + + /** + * Creates a Point message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.Point + * @static + * @param {Object.} object Plain object + * @returns {proto.Point} Point + */ + Point.fromObject = function fromObject(object) { + if (object instanceof $root.proto.Point) + return object; + var message = new $root.proto.Point(); + if (object.x != null) + message.x = Number(object.x); + if (object.y != null) + message.y = Number(object.y); + return message; + }; + + /** + * Creates a plain object from a Point message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.Point + * @static + * @param {proto.Point} message Point + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Point.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.x = 0; + object.y = 0; + } + if (message.x != null && message.hasOwnProperty("x")) + object.x = options.json && !isFinite(message.x) ? String(message.x) : message.x; + if (message.y != null && message.hasOwnProperty("y")) + object.y = options.json && !isFinite(message.y) ? String(message.y) : message.y; + return object; + }; + + /** + * Converts this Point to JSON. + * @function toJSON + * @memberof proto.Point + * @instance + * @returns {Object.} JSON object + */ + Point.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Point; + })(); + + proto.InteractiveAnnotation = (function() { + + /** + * Properties of an InteractiveAnnotation. + * @memberof proto + * @interface IInteractiveAnnotation + * @property {Array.|null} [polygonVertices] InteractiveAnnotation polygonVertices + * @property {proto.ILocation|null} [location] InteractiveAnnotation location + */ + + /** + * Constructs a new InteractiveAnnotation. + * @memberof proto + * @classdesc Represents an InteractiveAnnotation. + * @implements IInteractiveAnnotation + * @constructor + * @param {proto.IInteractiveAnnotation=} [properties] Properties to set + */ + function InteractiveAnnotation(properties) { + this.polygonVertices = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InteractiveAnnotation polygonVertices. + * @member {Array.} polygonVertices + * @memberof proto.InteractiveAnnotation + * @instance + */ + InteractiveAnnotation.prototype.polygonVertices = $util.emptyArray; + + /** + * InteractiveAnnotation location. + * @member {proto.ILocation|null|undefined} location + * @memberof proto.InteractiveAnnotation + * @instance + */ + InteractiveAnnotation.prototype.location = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InteractiveAnnotation action. + * @member {"location"|undefined} action + * @memberof proto.InteractiveAnnotation + * @instance + */ + Object.defineProperty(InteractiveAnnotation.prototype, "action", { + get: $util.oneOfGetter($oneOfFields = ["location"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InteractiveAnnotation instance using the specified properties. + * @function create + * @memberof proto.InteractiveAnnotation + * @static + * @param {proto.IInteractiveAnnotation=} [properties] Properties to set + * @returns {proto.InteractiveAnnotation} InteractiveAnnotation instance + */ + InteractiveAnnotation.create = function create(properties) { + return new InteractiveAnnotation(properties); + }; + + /** + * Encodes the specified InteractiveAnnotation message. Does not implicitly {@link proto.InteractiveAnnotation.verify|verify} messages. + * @function encode + * @memberof proto.InteractiveAnnotation + * @static + * @param {proto.IInteractiveAnnotation} message InteractiveAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InteractiveAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.polygonVertices != null && message.polygonVertices.length) + for (var i = 0; i < message.polygonVertices.length; ++i) + $root.proto.Point.encode(message.polygonVertices[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + $root.proto.Location.encode(message.location, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InteractiveAnnotation message, length delimited. Does not implicitly {@link proto.InteractiveAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.InteractiveAnnotation + * @static + * @param {proto.IInteractiveAnnotation} message InteractiveAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InteractiveAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InteractiveAnnotation message from the specified reader or buffer. + * @function decode + * @memberof proto.InteractiveAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.InteractiveAnnotation} InteractiveAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InteractiveAnnotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.InteractiveAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.polygonVertices && message.polygonVertices.length)) + message.polygonVertices = []; + message.polygonVertices.push($root.proto.Point.decode(reader, reader.uint32())); + break; + case 2: + message.location = $root.proto.Location.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InteractiveAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.InteractiveAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.InteractiveAnnotation} InteractiveAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InteractiveAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InteractiveAnnotation message. + * @function verify + * @memberof proto.InteractiveAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InteractiveAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.polygonVertices != null && message.hasOwnProperty("polygonVertices")) { + if (!Array.isArray(message.polygonVertices)) + return "polygonVertices: array expected"; + for (var i = 0; i < message.polygonVertices.length; ++i) { + var error = $root.proto.Point.verify(message.polygonVertices[i]); + if (error) + return "polygonVertices." + error; + } + } + if (message.location != null && message.hasOwnProperty("location")) { + properties.action = 1; + { + var error = $root.proto.Location.verify(message.location); + if (error) + return "location." + error; + } + } + return null; + }; + + /** + * Creates an InteractiveAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.InteractiveAnnotation + * @static + * @param {Object.} object Plain object + * @returns {proto.InteractiveAnnotation} InteractiveAnnotation + */ + InteractiveAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.proto.InteractiveAnnotation) + return object; + var message = new $root.proto.InteractiveAnnotation(); + if (object.polygonVertices) { + if (!Array.isArray(object.polygonVertices)) + throw TypeError(".proto.InteractiveAnnotation.polygonVertices: array expected"); + message.polygonVertices = []; + for (var i = 0; i < object.polygonVertices.length; ++i) { + if (typeof object.polygonVertices[i] !== "object") + throw TypeError(".proto.InteractiveAnnotation.polygonVertices: object expected"); + message.polygonVertices[i] = $root.proto.Point.fromObject(object.polygonVertices[i]); + } + } + if (object.location != null) { + if (typeof object.location !== "object") + throw TypeError(".proto.InteractiveAnnotation.location: object expected"); + message.location = $root.proto.Location.fromObject(object.location); + } + return message; + }; + + /** + * Creates a plain object from an InteractiveAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.InteractiveAnnotation + * @static + * @param {proto.InteractiveAnnotation} message InteractiveAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InteractiveAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.polygonVertices = []; + if (message.polygonVertices && message.polygonVertices.length) { + object.polygonVertices = []; + for (var j = 0; j < message.polygonVertices.length; ++j) + object.polygonVertices[j] = $root.proto.Point.toObject(message.polygonVertices[j], options); + } + if (message.location != null && message.hasOwnProperty("location")) { + object.location = $root.proto.Location.toObject(message.location, options); + if (options.oneofs) + object.action = "location"; + } + return object; + }; + + /** + * Converts this InteractiveAnnotation to JSON. + * @function toJSON + * @memberof proto.InteractiveAnnotation + * @instance + * @returns {Object.} JSON object + */ + InteractiveAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InteractiveAnnotation; + })(); + + proto.AdReplyInfo = (function() { + + /** + * Properties of an AdReplyInfo. + * @memberof proto + * @interface IAdReplyInfo + * @property {string|null} [advertiserName] AdReplyInfo advertiserName + * @property {proto.AdReplyInfo.AD_REPLY_INFO_MEDIATYPE|null} [mediaType] AdReplyInfo mediaType + * @property {Uint8Array|null} [jpegThumbnail] AdReplyInfo jpegThumbnail + * @property {string|null} [caption] AdReplyInfo caption + */ + + /** + * Constructs a new AdReplyInfo. + * @memberof proto + * @classdesc Represents an AdReplyInfo. + * @implements IAdReplyInfo + * @constructor + * @param {proto.IAdReplyInfo=} [properties] Properties to set + */ + function AdReplyInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AdReplyInfo advertiserName. + * @member {string} advertiserName + * @memberof proto.AdReplyInfo + * @instance + */ + AdReplyInfo.prototype.advertiserName = ""; + + /** + * AdReplyInfo mediaType. + * @member {proto.AdReplyInfo.AD_REPLY_INFO_MEDIATYPE} mediaType + * @memberof proto.AdReplyInfo + * @instance + */ + AdReplyInfo.prototype.mediaType = 0; + + /** + * AdReplyInfo jpegThumbnail. + * @member {Uint8Array} jpegThumbnail + * @memberof proto.AdReplyInfo + * @instance + */ + AdReplyInfo.prototype.jpegThumbnail = $util.newBuffer([]); + + /** + * AdReplyInfo caption. + * @member {string} caption + * @memberof proto.AdReplyInfo + * @instance + */ + AdReplyInfo.prototype.caption = ""; + + /** + * Creates a new AdReplyInfo instance using the specified properties. + * @function create + * @memberof proto.AdReplyInfo + * @static + * @param {proto.IAdReplyInfo=} [properties] Properties to set + * @returns {proto.AdReplyInfo} AdReplyInfo instance + */ + AdReplyInfo.create = function create(properties) { + return new AdReplyInfo(properties); + }; + + /** + * Encodes the specified AdReplyInfo message. Does not implicitly {@link proto.AdReplyInfo.verify|verify} messages. + * @function encode + * @memberof proto.AdReplyInfo + * @static + * @param {proto.IAdReplyInfo} message AdReplyInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AdReplyInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.advertiserName != null && Object.hasOwnProperty.call(message, "advertiserName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.advertiserName); + if (message.mediaType != null && Object.hasOwnProperty.call(message, "mediaType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.mediaType); + if (message.jpegThumbnail != null && Object.hasOwnProperty.call(message, "jpegThumbnail")) + writer.uint32(/* id 16, wireType 2 =*/130).bytes(message.jpegThumbnail); + if (message.caption != null && Object.hasOwnProperty.call(message, "caption")) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.caption); + return writer; + }; + + /** + * Encodes the specified AdReplyInfo message, length delimited. Does not implicitly {@link proto.AdReplyInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.AdReplyInfo + * @static + * @param {proto.IAdReplyInfo} message AdReplyInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AdReplyInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AdReplyInfo message from the specified reader or buffer. + * @function decode + * @memberof proto.AdReplyInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.AdReplyInfo} AdReplyInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AdReplyInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.AdReplyInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.advertiserName = reader.string(); + break; + case 2: + message.mediaType = reader.int32(); + break; + case 16: + message.jpegThumbnail = reader.bytes(); + break; + case 17: + message.caption = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AdReplyInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.AdReplyInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.AdReplyInfo} AdReplyInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AdReplyInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AdReplyInfo message. + * @function verify + * @memberof proto.AdReplyInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AdReplyInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.advertiserName != null && message.hasOwnProperty("advertiserName")) + if (!$util.isString(message.advertiserName)) + return "advertiserName: string expected"; + if (message.mediaType != null && message.hasOwnProperty("mediaType")) + switch (message.mediaType) { + default: + return "mediaType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.jpegThumbnail != null && message.hasOwnProperty("jpegThumbnail")) + if (!(message.jpegThumbnail && typeof message.jpegThumbnail.length === "number" || $util.isString(message.jpegThumbnail))) + return "jpegThumbnail: buffer expected"; + if (message.caption != null && message.hasOwnProperty("caption")) + if (!$util.isString(message.caption)) + return "caption: string expected"; + return null; + }; + + /** + * Creates an AdReplyInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.AdReplyInfo + * @static + * @param {Object.} object Plain object + * @returns {proto.AdReplyInfo} AdReplyInfo + */ + AdReplyInfo.fromObject = function fromObject(object) { + if (object instanceof $root.proto.AdReplyInfo) + return object; + var message = new $root.proto.AdReplyInfo(); + if (object.advertiserName != null) + message.advertiserName = String(object.advertiserName); + switch (object.mediaType) { + case "NONE": + case 0: + message.mediaType = 0; + break; + case "IMAGE": + case 1: + message.mediaType = 1; + break; + case "VIDEO": + case 2: + message.mediaType = 2; + break; + } + if (object.jpegThumbnail != null) + if (typeof object.jpegThumbnail === "string") + $util.base64.decode(object.jpegThumbnail, message.jpegThumbnail = $util.newBuffer($util.base64.length(object.jpegThumbnail)), 0); + else if (object.jpegThumbnail.length) + message.jpegThumbnail = object.jpegThumbnail; + if (object.caption != null) + message.caption = String(object.caption); + return message; + }; + + /** + * Creates a plain object from an AdReplyInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.AdReplyInfo + * @static + * @param {proto.AdReplyInfo} message AdReplyInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AdReplyInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.advertiserName = ""; + object.mediaType = options.enums === String ? "NONE" : 0; + if (options.bytes === String) + object.jpegThumbnail = ""; + else { + object.jpegThumbnail = []; + if (options.bytes !== Array) + object.jpegThumbnail = $util.newBuffer(object.jpegThumbnail); + } + object.caption = ""; + } + if (message.advertiserName != null && message.hasOwnProperty("advertiserName")) + object.advertiserName = message.advertiserName; + if (message.mediaType != null && message.hasOwnProperty("mediaType")) + object.mediaType = options.enums === String ? $root.proto.AdReplyInfo.AD_REPLY_INFO_MEDIATYPE[message.mediaType] : message.mediaType; + if (message.jpegThumbnail != null && message.hasOwnProperty("jpegThumbnail")) + object.jpegThumbnail = options.bytes === String ? $util.base64.encode(message.jpegThumbnail, 0, message.jpegThumbnail.length) : options.bytes === Array ? Array.prototype.slice.call(message.jpegThumbnail) : message.jpegThumbnail; + if (message.caption != null && message.hasOwnProperty("caption")) + object.caption = message.caption; + return object; + }; + + /** + * Converts this AdReplyInfo to JSON. + * @function toJSON + * @memberof proto.AdReplyInfo + * @instance + * @returns {Object.} JSON object + */ + AdReplyInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * AD_REPLY_INFO_MEDIATYPE enum. + * @name proto.AdReplyInfo.AD_REPLY_INFO_MEDIATYPE + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} IMAGE=1 IMAGE value + * @property {number} VIDEO=2 VIDEO value + */ + AdReplyInfo.AD_REPLY_INFO_MEDIATYPE = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "IMAGE"] = 1; + values[valuesById[2] = "VIDEO"] = 2; + return values; + })(); + + return AdReplyInfo; + })(); + + proto.ContextInfo = (function() { + + /** + * Properties of a ContextInfo. + * @memberof proto + * @interface IContextInfo + * @property {string|null} [stanzaId] ContextInfo stanzaId + * @property {string|null} [participant] ContextInfo participant + * @property {proto.IMessage|null} [quotedMessage] ContextInfo quotedMessage + * @property {string|null} [remoteJid] ContextInfo remoteJid + * @property {Array.|null} [mentionedJid] ContextInfo mentionedJid + * @property {string|null} [conversionSource] ContextInfo conversionSource + * @property {Uint8Array|null} [conversionData] ContextInfo conversionData + * @property {number|null} [conversionDelaySeconds] ContextInfo conversionDelaySeconds + * @property {number|null} [forwardingScore] ContextInfo forwardingScore + * @property {boolean|null} [isForwarded] ContextInfo isForwarded + * @property {proto.IAdReplyInfo|null} [quotedAd] ContextInfo quotedAd + * @property {proto.IMessageKey|null} [placeholderKey] ContextInfo placeholderKey + * @property {number|null} [expiration] ContextInfo expiration + */ + + /** + * Constructs a new ContextInfo. + * @memberof proto + * @classdesc Represents a ContextInfo. + * @implements IContextInfo + * @constructor + * @param {proto.IContextInfo=} [properties] Properties to set + */ + function ContextInfo(properties) { + this.mentionedJid = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ContextInfo stanzaId. + * @member {string} stanzaId + * @memberof proto.ContextInfo + * @instance + */ + ContextInfo.prototype.stanzaId = ""; + + /** + * ContextInfo participant. + * @member {string} participant + * @memberof proto.ContextInfo + * @instance + */ + ContextInfo.prototype.participant = ""; + + /** + * ContextInfo quotedMessage. + * @member {proto.IMessage|null|undefined} quotedMessage + * @memberof proto.ContextInfo + * @instance + */ + ContextInfo.prototype.quotedMessage = null; + + /** + * ContextInfo remoteJid. + * @member {string} remoteJid + * @memberof proto.ContextInfo + * @instance + */ + ContextInfo.prototype.remoteJid = ""; + + /** + * ContextInfo mentionedJid. + * @member {Array.} mentionedJid + * @memberof proto.ContextInfo + * @instance + */ + ContextInfo.prototype.mentionedJid = $util.emptyArray; + + /** + * ContextInfo conversionSource. + * @member {string} conversionSource + * @memberof proto.ContextInfo + * @instance + */ + ContextInfo.prototype.conversionSource = ""; + + /** + * ContextInfo conversionData. + * @member {Uint8Array} conversionData + * @memberof proto.ContextInfo + * @instance + */ + ContextInfo.prototype.conversionData = $util.newBuffer([]); + + /** + * ContextInfo conversionDelaySeconds. + * @member {number} conversionDelaySeconds + * @memberof proto.ContextInfo + * @instance + */ + ContextInfo.prototype.conversionDelaySeconds = 0; + + /** + * ContextInfo forwardingScore. + * @member {number} forwardingScore + * @memberof proto.ContextInfo + * @instance + */ + ContextInfo.prototype.forwardingScore = 0; + + /** + * ContextInfo isForwarded. + * @member {boolean} isForwarded + * @memberof proto.ContextInfo + * @instance + */ + ContextInfo.prototype.isForwarded = false; + + /** + * ContextInfo quotedAd. + * @member {proto.IAdReplyInfo|null|undefined} quotedAd + * @memberof proto.ContextInfo + * @instance + */ + ContextInfo.prototype.quotedAd = null; + + /** + * ContextInfo placeholderKey. + * @member {proto.IMessageKey|null|undefined} placeholderKey + * @memberof proto.ContextInfo + * @instance + */ + ContextInfo.prototype.placeholderKey = null; + + /** + * ContextInfo expiration. + * @member {number} expiration + * @memberof proto.ContextInfo + * @instance + */ + ContextInfo.prototype.expiration = 0; + + /** + * Creates a new ContextInfo instance using the specified properties. + * @function create + * @memberof proto.ContextInfo + * @static + * @param {proto.IContextInfo=} [properties] Properties to set + * @returns {proto.ContextInfo} ContextInfo instance + */ + ContextInfo.create = function create(properties) { + return new ContextInfo(properties); + }; + + /** + * Encodes the specified ContextInfo message. Does not implicitly {@link proto.ContextInfo.verify|verify} messages. + * @function encode + * @memberof proto.ContextInfo + * @static + * @param {proto.IContextInfo} message ContextInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContextInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.stanzaId != null && Object.hasOwnProperty.call(message, "stanzaId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.stanzaId); + if (message.participant != null && Object.hasOwnProperty.call(message, "participant")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.participant); + if (message.quotedMessage != null && Object.hasOwnProperty.call(message, "quotedMessage")) + $root.proto.Message.encode(message.quotedMessage, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.remoteJid != null && Object.hasOwnProperty.call(message, "remoteJid")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.remoteJid); + if (message.mentionedJid != null && message.mentionedJid.length) + for (var i = 0; i < message.mentionedJid.length; ++i) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.mentionedJid[i]); + if (message.conversionSource != null && Object.hasOwnProperty.call(message, "conversionSource")) + writer.uint32(/* id 18, wireType 2 =*/146).string(message.conversionSource); + if (message.conversionData != null && Object.hasOwnProperty.call(message, "conversionData")) + writer.uint32(/* id 19, wireType 2 =*/154).bytes(message.conversionData); + if (message.conversionDelaySeconds != null && Object.hasOwnProperty.call(message, "conversionDelaySeconds")) + writer.uint32(/* id 20, wireType 0 =*/160).uint32(message.conversionDelaySeconds); + if (message.forwardingScore != null && Object.hasOwnProperty.call(message, "forwardingScore")) + writer.uint32(/* id 21, wireType 0 =*/168).uint32(message.forwardingScore); + if (message.isForwarded != null && Object.hasOwnProperty.call(message, "isForwarded")) + writer.uint32(/* id 22, wireType 0 =*/176).bool(message.isForwarded); + if (message.quotedAd != null && Object.hasOwnProperty.call(message, "quotedAd")) + $root.proto.AdReplyInfo.encode(message.quotedAd, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.placeholderKey != null && Object.hasOwnProperty.call(message, "placeholderKey")) + $root.proto.MessageKey.encode(message.placeholderKey, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.expiration != null && Object.hasOwnProperty.call(message, "expiration")) + writer.uint32(/* id 25, wireType 0 =*/200).uint32(message.expiration); + return writer; + }; + + /** + * Encodes the specified ContextInfo message, length delimited. Does not implicitly {@link proto.ContextInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.ContextInfo + * @static + * @param {proto.IContextInfo} message ContextInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContextInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContextInfo message from the specified reader or buffer. + * @function decode + * @memberof proto.ContextInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.ContextInfo} ContextInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContextInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ContextInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.stanzaId = reader.string(); + break; + case 2: + message.participant = reader.string(); + break; + case 3: + message.quotedMessage = $root.proto.Message.decode(reader, reader.uint32()); + break; + case 4: + message.remoteJid = reader.string(); + break; + case 15: + if (!(message.mentionedJid && message.mentionedJid.length)) + message.mentionedJid = []; + message.mentionedJid.push(reader.string()); + break; + case 18: + message.conversionSource = reader.string(); + break; + case 19: + message.conversionData = reader.bytes(); + break; + case 20: + message.conversionDelaySeconds = reader.uint32(); + break; + case 21: + message.forwardingScore = reader.uint32(); + break; + case 22: + message.isForwarded = reader.bool(); + break; + case 23: + message.quotedAd = $root.proto.AdReplyInfo.decode(reader, reader.uint32()); + break; + case 24: + message.placeholderKey = $root.proto.MessageKey.decode(reader, reader.uint32()); + break; + case 25: + message.expiration = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContextInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.ContextInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.ContextInfo} ContextInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContextInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContextInfo message. + * @function verify + * @memberof proto.ContextInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContextInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.stanzaId != null && message.hasOwnProperty("stanzaId")) + if (!$util.isString(message.stanzaId)) + return "stanzaId: string expected"; + if (message.participant != null && message.hasOwnProperty("participant")) + if (!$util.isString(message.participant)) + return "participant: string expected"; + if (message.quotedMessage != null && message.hasOwnProperty("quotedMessage")) { + var error = $root.proto.Message.verify(message.quotedMessage); + if (error) + return "quotedMessage." + error; + } + if (message.remoteJid != null && message.hasOwnProperty("remoteJid")) + if (!$util.isString(message.remoteJid)) + return "remoteJid: string expected"; + if (message.mentionedJid != null && message.hasOwnProperty("mentionedJid")) { + if (!Array.isArray(message.mentionedJid)) + return "mentionedJid: array expected"; + for (var i = 0; i < message.mentionedJid.length; ++i) + if (!$util.isString(message.mentionedJid[i])) + return "mentionedJid: string[] expected"; + } + if (message.conversionSource != null && message.hasOwnProperty("conversionSource")) + if (!$util.isString(message.conversionSource)) + return "conversionSource: string expected"; + if (message.conversionData != null && message.hasOwnProperty("conversionData")) + if (!(message.conversionData && typeof message.conversionData.length === "number" || $util.isString(message.conversionData))) + return "conversionData: buffer expected"; + if (message.conversionDelaySeconds != null && message.hasOwnProperty("conversionDelaySeconds")) + if (!$util.isInteger(message.conversionDelaySeconds)) + return "conversionDelaySeconds: integer expected"; + if (message.forwardingScore != null && message.hasOwnProperty("forwardingScore")) + if (!$util.isInteger(message.forwardingScore)) + return "forwardingScore: integer expected"; + if (message.isForwarded != null && message.hasOwnProperty("isForwarded")) + if (typeof message.isForwarded !== "boolean") + return "isForwarded: boolean expected"; + if (message.quotedAd != null && message.hasOwnProperty("quotedAd")) { + var error = $root.proto.AdReplyInfo.verify(message.quotedAd); + if (error) + return "quotedAd." + error; + } + if (message.placeholderKey != null && message.hasOwnProperty("placeholderKey")) { + var error = $root.proto.MessageKey.verify(message.placeholderKey); + if (error) + return "placeholderKey." + error; + } + if (message.expiration != null && message.hasOwnProperty("expiration")) + if (!$util.isInteger(message.expiration)) + return "expiration: integer expected"; + return null; + }; + + /** + * Creates a ContextInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.ContextInfo + * @static + * @param {Object.} object Plain object + * @returns {proto.ContextInfo} ContextInfo + */ + ContextInfo.fromObject = function fromObject(object) { + if (object instanceof $root.proto.ContextInfo) + return object; + var message = new $root.proto.ContextInfo(); + if (object.stanzaId != null) + message.stanzaId = String(object.stanzaId); + if (object.participant != null) + message.participant = String(object.participant); + if (object.quotedMessage != null) { + if (typeof object.quotedMessage !== "object") + throw TypeError(".proto.ContextInfo.quotedMessage: object expected"); + message.quotedMessage = $root.proto.Message.fromObject(object.quotedMessage); + } + if (object.remoteJid != null) + message.remoteJid = String(object.remoteJid); + if (object.mentionedJid) { + if (!Array.isArray(object.mentionedJid)) + throw TypeError(".proto.ContextInfo.mentionedJid: array expected"); + message.mentionedJid = []; + for (var i = 0; i < object.mentionedJid.length; ++i) + message.mentionedJid[i] = String(object.mentionedJid[i]); + } + if (object.conversionSource != null) + message.conversionSource = String(object.conversionSource); + if (object.conversionData != null) + if (typeof object.conversionData === "string") + $util.base64.decode(object.conversionData, message.conversionData = $util.newBuffer($util.base64.length(object.conversionData)), 0); + else if (object.conversionData.length) + message.conversionData = object.conversionData; + if (object.conversionDelaySeconds != null) + message.conversionDelaySeconds = object.conversionDelaySeconds >>> 0; + if (object.forwardingScore != null) + message.forwardingScore = object.forwardingScore >>> 0; + if (object.isForwarded != null) + message.isForwarded = Boolean(object.isForwarded); + if (object.quotedAd != null) { + if (typeof object.quotedAd !== "object") + throw TypeError(".proto.ContextInfo.quotedAd: object expected"); + message.quotedAd = $root.proto.AdReplyInfo.fromObject(object.quotedAd); + } + if (object.placeholderKey != null) { + if (typeof object.placeholderKey !== "object") + throw TypeError(".proto.ContextInfo.placeholderKey: object expected"); + message.placeholderKey = $root.proto.MessageKey.fromObject(object.placeholderKey); + } + if (object.expiration != null) + message.expiration = object.expiration >>> 0; + return message; + }; + + /** + * Creates a plain object from a ContextInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.ContextInfo + * @static + * @param {proto.ContextInfo} message ContextInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContextInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.mentionedJid = []; + if (options.defaults) { + object.stanzaId = ""; + object.participant = ""; + object.quotedMessage = null; + object.remoteJid = ""; + object.conversionSource = ""; + if (options.bytes === String) + object.conversionData = ""; + else { + object.conversionData = []; + if (options.bytes !== Array) + object.conversionData = $util.newBuffer(object.conversionData); + } + object.conversionDelaySeconds = 0; + object.forwardingScore = 0; + object.isForwarded = false; + object.quotedAd = null; + object.placeholderKey = null; + object.expiration = 0; + } + if (message.stanzaId != null && message.hasOwnProperty("stanzaId")) + object.stanzaId = message.stanzaId; + if (message.participant != null && message.hasOwnProperty("participant")) + object.participant = message.participant; + if (message.quotedMessage != null && message.hasOwnProperty("quotedMessage")) + object.quotedMessage = $root.proto.Message.toObject(message.quotedMessage, options); + if (message.remoteJid != null && message.hasOwnProperty("remoteJid")) + object.remoteJid = message.remoteJid; + if (message.mentionedJid && message.mentionedJid.length) { + object.mentionedJid = []; + for (var j = 0; j < message.mentionedJid.length; ++j) + object.mentionedJid[j] = message.mentionedJid[j]; + } + if (message.conversionSource != null && message.hasOwnProperty("conversionSource")) + object.conversionSource = message.conversionSource; + if (message.conversionData != null && message.hasOwnProperty("conversionData")) + object.conversionData = options.bytes === String ? $util.base64.encode(message.conversionData, 0, message.conversionData.length) : options.bytes === Array ? Array.prototype.slice.call(message.conversionData) : message.conversionData; + if (message.conversionDelaySeconds != null && message.hasOwnProperty("conversionDelaySeconds")) + object.conversionDelaySeconds = message.conversionDelaySeconds; + if (message.forwardingScore != null && message.hasOwnProperty("forwardingScore")) + object.forwardingScore = message.forwardingScore; + if (message.isForwarded != null && message.hasOwnProperty("isForwarded")) + object.isForwarded = message.isForwarded; + if (message.quotedAd != null && message.hasOwnProperty("quotedAd")) + object.quotedAd = $root.proto.AdReplyInfo.toObject(message.quotedAd, options); + if (message.placeholderKey != null && message.hasOwnProperty("placeholderKey")) + object.placeholderKey = $root.proto.MessageKey.toObject(message.placeholderKey, options); + if (message.expiration != null && message.hasOwnProperty("expiration")) + object.expiration = message.expiration; + return object; + }; + + /** + * Converts this ContextInfo to JSON. + * @function toJSON + * @memberof proto.ContextInfo + * @instance + * @returns {Object.} JSON object + */ + ContextInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ContextInfo; + })(); + + proto.SenderKeyDistributionMessage = (function() { + + /** + * Properties of a SenderKeyDistributionMessage. + * @memberof proto + * @interface ISenderKeyDistributionMessage + * @property {string|null} [groupId] SenderKeyDistributionMessage groupId + * @property {Uint8Array|null} [axolotlSenderKeyDistributionMessage] SenderKeyDistributionMessage axolotlSenderKeyDistributionMessage + */ + + /** + * Constructs a new SenderKeyDistributionMessage. + * @memberof proto + * @classdesc Represents a SenderKeyDistributionMessage. + * @implements ISenderKeyDistributionMessage + * @constructor + * @param {proto.ISenderKeyDistributionMessage=} [properties] Properties to set + */ + function SenderKeyDistributionMessage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SenderKeyDistributionMessage groupId. + * @member {string} groupId + * @memberof proto.SenderKeyDistributionMessage + * @instance + */ + SenderKeyDistributionMessage.prototype.groupId = ""; + + /** + * SenderKeyDistributionMessage axolotlSenderKeyDistributionMessage. + * @member {Uint8Array} axolotlSenderKeyDistributionMessage + * @memberof proto.SenderKeyDistributionMessage + * @instance + */ + SenderKeyDistributionMessage.prototype.axolotlSenderKeyDistributionMessage = $util.newBuffer([]); + + /** + * Creates a new SenderKeyDistributionMessage instance using the specified properties. + * @function create + * @memberof proto.SenderKeyDistributionMessage + * @static + * @param {proto.ISenderKeyDistributionMessage=} [properties] Properties to set + * @returns {proto.SenderKeyDistributionMessage} SenderKeyDistributionMessage instance + */ + SenderKeyDistributionMessage.create = function create(properties) { + return new SenderKeyDistributionMessage(properties); + }; + + /** + * Encodes the specified SenderKeyDistributionMessage message. Does not implicitly {@link proto.SenderKeyDistributionMessage.verify|verify} messages. + * @function encode + * @memberof proto.SenderKeyDistributionMessage + * @static + * @param {proto.ISenderKeyDistributionMessage} message SenderKeyDistributionMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SenderKeyDistributionMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.groupId != null && Object.hasOwnProperty.call(message, "groupId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.groupId); + if (message.axolotlSenderKeyDistributionMessage != null && Object.hasOwnProperty.call(message, "axolotlSenderKeyDistributionMessage")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.axolotlSenderKeyDistributionMessage); + return writer; + }; + + /** + * Encodes the specified SenderKeyDistributionMessage message, length delimited. Does not implicitly {@link proto.SenderKeyDistributionMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.SenderKeyDistributionMessage + * @static + * @param {proto.ISenderKeyDistributionMessage} message SenderKeyDistributionMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SenderKeyDistributionMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SenderKeyDistributionMessage message from the specified reader or buffer. + * @function decode + * @memberof proto.SenderKeyDistributionMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.SenderKeyDistributionMessage} SenderKeyDistributionMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SenderKeyDistributionMessage.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.SenderKeyDistributionMessage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.groupId = reader.string(); + break; + case 2: + message.axolotlSenderKeyDistributionMessage = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SenderKeyDistributionMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.SenderKeyDistributionMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.SenderKeyDistributionMessage} SenderKeyDistributionMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SenderKeyDistributionMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SenderKeyDistributionMessage message. + * @function verify + * @memberof proto.SenderKeyDistributionMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SenderKeyDistributionMessage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.groupId != null && message.hasOwnProperty("groupId")) + if (!$util.isString(message.groupId)) + return "groupId: string expected"; + if (message.axolotlSenderKeyDistributionMessage != null && message.hasOwnProperty("axolotlSenderKeyDistributionMessage")) + if (!(message.axolotlSenderKeyDistributionMessage && typeof message.axolotlSenderKeyDistributionMessage.length === "number" || $util.isString(message.axolotlSenderKeyDistributionMessage))) + return "axolotlSenderKeyDistributionMessage: buffer expected"; + return null; + }; + + /** + * Creates a SenderKeyDistributionMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.SenderKeyDistributionMessage + * @static + * @param {Object.} object Plain object + * @returns {proto.SenderKeyDistributionMessage} SenderKeyDistributionMessage + */ + SenderKeyDistributionMessage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.SenderKeyDistributionMessage) + return object; + var message = new $root.proto.SenderKeyDistributionMessage(); + if (object.groupId != null) + message.groupId = String(object.groupId); + if (object.axolotlSenderKeyDistributionMessage != null) + if (typeof object.axolotlSenderKeyDistributionMessage === "string") + $util.base64.decode(object.axolotlSenderKeyDistributionMessage, message.axolotlSenderKeyDistributionMessage = $util.newBuffer($util.base64.length(object.axolotlSenderKeyDistributionMessage)), 0); + else if (object.axolotlSenderKeyDistributionMessage.length) + message.axolotlSenderKeyDistributionMessage = object.axolotlSenderKeyDistributionMessage; + return message; + }; + + /** + * Creates a plain object from a SenderKeyDistributionMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.SenderKeyDistributionMessage + * @static + * @param {proto.SenderKeyDistributionMessage} message SenderKeyDistributionMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SenderKeyDistributionMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.groupId = ""; + if (options.bytes === String) + object.axolotlSenderKeyDistributionMessage = ""; + else { + object.axolotlSenderKeyDistributionMessage = []; + if (options.bytes !== Array) + object.axolotlSenderKeyDistributionMessage = $util.newBuffer(object.axolotlSenderKeyDistributionMessage); + } + } + if (message.groupId != null && message.hasOwnProperty("groupId")) + object.groupId = message.groupId; + if (message.axolotlSenderKeyDistributionMessage != null && message.hasOwnProperty("axolotlSenderKeyDistributionMessage")) + object.axolotlSenderKeyDistributionMessage = options.bytes === String ? $util.base64.encode(message.axolotlSenderKeyDistributionMessage, 0, message.axolotlSenderKeyDistributionMessage.length) : options.bytes === Array ? Array.prototype.slice.call(message.axolotlSenderKeyDistributionMessage) : message.axolotlSenderKeyDistributionMessage; + return object; + }; + + /** + * Converts this SenderKeyDistributionMessage to JSON. + * @function toJSON + * @memberof proto.SenderKeyDistributionMessage + * @instance + * @returns {Object.} JSON object + */ + SenderKeyDistributionMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SenderKeyDistributionMessage; + })(); + + proto.ImageMessage = (function() { + + /** + * Properties of an ImageMessage. + * @memberof proto + * @interface IImageMessage + * @property {string|null} [url] ImageMessage url + * @property {string|null} [mimetype] ImageMessage mimetype + * @property {string|null} [caption] ImageMessage caption + * @property {Uint8Array|null} [fileSha256] ImageMessage fileSha256 + * @property {number|Long|null} [fileLength] ImageMessage fileLength + * @property {number|null} [height] ImageMessage height + * @property {number|null} [width] ImageMessage width + * @property {Uint8Array|null} [mediaKey] ImageMessage mediaKey + * @property {Uint8Array|null} [fileEncSha256] ImageMessage fileEncSha256 + * @property {Array.|null} [interactiveAnnotations] ImageMessage interactiveAnnotations + * @property {string|null} [directPath] ImageMessage directPath + * @property {number|Long|null} [mediaKeyTimestamp] ImageMessage mediaKeyTimestamp + * @property {Uint8Array|null} [jpegThumbnail] ImageMessage jpegThumbnail + * @property {proto.IContextInfo|null} [contextInfo] ImageMessage contextInfo + * @property {Uint8Array|null} [firstScanSidecar] ImageMessage firstScanSidecar + * @property {number|null} [firstScanLength] ImageMessage firstScanLength + * @property {number|null} [experimentGroupId] ImageMessage experimentGroupId + * @property {Uint8Array|null} [scansSidecar] ImageMessage scansSidecar + * @property {Array.|null} [scanLengths] ImageMessage scanLengths + * @property {Uint8Array|null} [midQualityFileSha256] ImageMessage midQualityFileSha256 + * @property {Uint8Array|null} [midQualityFileEncSha256] ImageMessage midQualityFileEncSha256 + */ + + /** + * Constructs a new ImageMessage. + * @memberof proto + * @classdesc Represents an ImageMessage. + * @implements IImageMessage + * @constructor + * @param {proto.IImageMessage=} [properties] Properties to set + */ + function ImageMessage(properties) { + this.interactiveAnnotations = []; + this.scanLengths = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImageMessage url. + * @member {string} url + * @memberof proto.ImageMessage + * @instance + */ + ImageMessage.prototype.url = ""; + + /** + * ImageMessage mimetype. + * @member {string} mimetype + * @memberof proto.ImageMessage + * @instance + */ + ImageMessage.prototype.mimetype = ""; + + /** + * ImageMessage caption. + * @member {string} caption + * @memberof proto.ImageMessage + * @instance + */ + ImageMessage.prototype.caption = ""; + + /** + * ImageMessage fileSha256. + * @member {Uint8Array} fileSha256 + * @memberof proto.ImageMessage + * @instance + */ + ImageMessage.prototype.fileSha256 = $util.newBuffer([]); + + /** + * ImageMessage fileLength. + * @member {number|Long} fileLength + * @memberof proto.ImageMessage + * @instance + */ + ImageMessage.prototype.fileLength = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * ImageMessage height. + * @member {number} height + * @memberof proto.ImageMessage + * @instance + */ + ImageMessage.prototype.height = 0; + + /** + * ImageMessage width. + * @member {number} width + * @memberof proto.ImageMessage + * @instance + */ + ImageMessage.prototype.width = 0; + + /** + * ImageMessage mediaKey. + * @member {Uint8Array} mediaKey + * @memberof proto.ImageMessage + * @instance + */ + ImageMessage.prototype.mediaKey = $util.newBuffer([]); + + /** + * ImageMessage fileEncSha256. + * @member {Uint8Array} fileEncSha256 + * @memberof proto.ImageMessage + * @instance + */ + ImageMessage.prototype.fileEncSha256 = $util.newBuffer([]); + + /** + * ImageMessage interactiveAnnotations. + * @member {Array.} interactiveAnnotations + * @memberof proto.ImageMessage + * @instance + */ + ImageMessage.prototype.interactiveAnnotations = $util.emptyArray; + + /** + * ImageMessage directPath. + * @member {string} directPath + * @memberof proto.ImageMessage + * @instance + */ + ImageMessage.prototype.directPath = ""; + + /** + * ImageMessage mediaKeyTimestamp. + * @member {number|Long} mediaKeyTimestamp + * @memberof proto.ImageMessage + * @instance + */ + ImageMessage.prototype.mediaKeyTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ImageMessage jpegThumbnail. + * @member {Uint8Array} jpegThumbnail + * @memberof proto.ImageMessage + * @instance + */ + ImageMessage.prototype.jpegThumbnail = $util.newBuffer([]); + + /** + * ImageMessage contextInfo. + * @member {proto.IContextInfo|null|undefined} contextInfo + * @memberof proto.ImageMessage + * @instance + */ + ImageMessage.prototype.contextInfo = null; + + /** + * ImageMessage firstScanSidecar. + * @member {Uint8Array} firstScanSidecar + * @memberof proto.ImageMessage + * @instance + */ + ImageMessage.prototype.firstScanSidecar = $util.newBuffer([]); + + /** + * ImageMessage firstScanLength. + * @member {number} firstScanLength + * @memberof proto.ImageMessage + * @instance + */ + ImageMessage.prototype.firstScanLength = 0; + + /** + * ImageMessage experimentGroupId. + * @member {number} experimentGroupId + * @memberof proto.ImageMessage + * @instance + */ + ImageMessage.prototype.experimentGroupId = 0; + + /** + * ImageMessage scansSidecar. + * @member {Uint8Array} scansSidecar + * @memberof proto.ImageMessage + * @instance + */ + ImageMessage.prototype.scansSidecar = $util.newBuffer([]); + + /** + * ImageMessage scanLengths. + * @member {Array.} scanLengths + * @memberof proto.ImageMessage + * @instance + */ + ImageMessage.prototype.scanLengths = $util.emptyArray; + + /** + * ImageMessage midQualityFileSha256. + * @member {Uint8Array} midQualityFileSha256 + * @memberof proto.ImageMessage + * @instance + */ + ImageMessage.prototype.midQualityFileSha256 = $util.newBuffer([]); + + /** + * ImageMessage midQualityFileEncSha256. + * @member {Uint8Array} midQualityFileEncSha256 + * @memberof proto.ImageMessage + * @instance + */ + ImageMessage.prototype.midQualityFileEncSha256 = $util.newBuffer([]); + + /** + * Creates a new ImageMessage instance using the specified properties. + * @function create + * @memberof proto.ImageMessage + * @static + * @param {proto.IImageMessage=} [properties] Properties to set + * @returns {proto.ImageMessage} ImageMessage instance + */ + ImageMessage.create = function create(properties) { + return new ImageMessage(properties); + }; + + /** + * Encodes the specified ImageMessage message. Does not implicitly {@link proto.ImageMessage.verify|verify} messages. + * @function encode + * @memberof proto.ImageMessage + * @static + * @param {proto.IImageMessage} message ImageMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.url != null && Object.hasOwnProperty.call(message, "url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.url); + if (message.mimetype != null && Object.hasOwnProperty.call(message, "mimetype")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.mimetype); + if (message.caption != null && Object.hasOwnProperty.call(message, "caption")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.caption); + if (message.fileSha256 != null && Object.hasOwnProperty.call(message, "fileSha256")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.fileSha256); + if (message.fileLength != null && Object.hasOwnProperty.call(message, "fileLength")) + writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.fileLength); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.height); + if (message.width != null && Object.hasOwnProperty.call(message, "width")) + writer.uint32(/* id 7, wireType 0 =*/56).uint32(message.width); + if (message.mediaKey != null && Object.hasOwnProperty.call(message, "mediaKey")) + writer.uint32(/* id 8, wireType 2 =*/66).bytes(message.mediaKey); + if (message.fileEncSha256 != null && Object.hasOwnProperty.call(message, "fileEncSha256")) + writer.uint32(/* id 9, wireType 2 =*/74).bytes(message.fileEncSha256); + if (message.interactiveAnnotations != null && message.interactiveAnnotations.length) + for (var i = 0; i < message.interactiveAnnotations.length; ++i) + $root.proto.InteractiveAnnotation.encode(message.interactiveAnnotations[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.directPath != null && Object.hasOwnProperty.call(message, "directPath")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.directPath); + if (message.mediaKeyTimestamp != null && Object.hasOwnProperty.call(message, "mediaKeyTimestamp")) + writer.uint32(/* id 12, wireType 0 =*/96).int64(message.mediaKeyTimestamp); + if (message.jpegThumbnail != null && Object.hasOwnProperty.call(message, "jpegThumbnail")) + writer.uint32(/* id 16, wireType 2 =*/130).bytes(message.jpegThumbnail); + if (message.contextInfo != null && Object.hasOwnProperty.call(message, "contextInfo")) + $root.proto.ContextInfo.encode(message.contextInfo, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.firstScanSidecar != null && Object.hasOwnProperty.call(message, "firstScanSidecar")) + writer.uint32(/* id 18, wireType 2 =*/146).bytes(message.firstScanSidecar); + if (message.firstScanLength != null && Object.hasOwnProperty.call(message, "firstScanLength")) + writer.uint32(/* id 19, wireType 0 =*/152).uint32(message.firstScanLength); + if (message.experimentGroupId != null && Object.hasOwnProperty.call(message, "experimentGroupId")) + writer.uint32(/* id 20, wireType 0 =*/160).uint32(message.experimentGroupId); + if (message.scansSidecar != null && Object.hasOwnProperty.call(message, "scansSidecar")) + writer.uint32(/* id 21, wireType 2 =*/170).bytes(message.scansSidecar); + if (message.scanLengths != null && message.scanLengths.length) + for (var i = 0; i < message.scanLengths.length; ++i) + writer.uint32(/* id 22, wireType 0 =*/176).uint32(message.scanLengths[i]); + if (message.midQualityFileSha256 != null && Object.hasOwnProperty.call(message, "midQualityFileSha256")) + writer.uint32(/* id 23, wireType 2 =*/186).bytes(message.midQualityFileSha256); + if (message.midQualityFileEncSha256 != null && Object.hasOwnProperty.call(message, "midQualityFileEncSha256")) + writer.uint32(/* id 24, wireType 2 =*/194).bytes(message.midQualityFileEncSha256); + return writer; + }; + + /** + * Encodes the specified ImageMessage message, length delimited. Does not implicitly {@link proto.ImageMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.ImageMessage + * @static + * @param {proto.IImageMessage} message ImageMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageMessage message from the specified reader or buffer. + * @function decode + * @memberof proto.ImageMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.ImageMessage} ImageMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageMessage.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ImageMessage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.url = reader.string(); + break; + case 2: + message.mimetype = reader.string(); + break; + case 3: + message.caption = reader.string(); + break; + case 4: + message.fileSha256 = reader.bytes(); + break; + case 5: + message.fileLength = reader.uint64(); + break; + case 6: + message.height = reader.uint32(); + break; + case 7: + message.width = reader.uint32(); + break; + case 8: + message.mediaKey = reader.bytes(); + break; + case 9: + message.fileEncSha256 = reader.bytes(); + break; + case 10: + if (!(message.interactiveAnnotations && message.interactiveAnnotations.length)) + message.interactiveAnnotations = []; + message.interactiveAnnotations.push($root.proto.InteractiveAnnotation.decode(reader, reader.uint32())); + break; + case 11: + message.directPath = reader.string(); + break; + case 12: + message.mediaKeyTimestamp = reader.int64(); + break; + case 16: + message.jpegThumbnail = reader.bytes(); + break; + case 17: + message.contextInfo = $root.proto.ContextInfo.decode(reader, reader.uint32()); + break; + case 18: + message.firstScanSidecar = reader.bytes(); + break; + case 19: + message.firstScanLength = reader.uint32(); + break; + case 20: + message.experimentGroupId = reader.uint32(); + break; + case 21: + message.scansSidecar = reader.bytes(); + break; + case 22: + if (!(message.scanLengths && message.scanLengths.length)) + message.scanLengths = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.scanLengths.push(reader.uint32()); + } else + message.scanLengths.push(reader.uint32()); + break; + case 23: + message.midQualityFileSha256 = reader.bytes(); + break; + case 24: + message.midQualityFileEncSha256 = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.ImageMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.ImageMessage} ImageMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageMessage message. + * @function verify + * @memberof proto.ImageMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageMessage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.url != null && message.hasOwnProperty("url")) + if (!$util.isString(message.url)) + return "url: string expected"; + if (message.mimetype != null && message.hasOwnProperty("mimetype")) + if (!$util.isString(message.mimetype)) + return "mimetype: string expected"; + if (message.caption != null && message.hasOwnProperty("caption")) + if (!$util.isString(message.caption)) + return "caption: string expected"; + if (message.fileSha256 != null && message.hasOwnProperty("fileSha256")) + if (!(message.fileSha256 && typeof message.fileSha256.length === "number" || $util.isString(message.fileSha256))) + return "fileSha256: buffer expected"; + if (message.fileLength != null && message.hasOwnProperty("fileLength")) + if (!$util.isInteger(message.fileLength) && !(message.fileLength && $util.isInteger(message.fileLength.low) && $util.isInteger(message.fileLength.high))) + return "fileLength: integer|Long expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height)) + return "height: integer expected"; + if (message.width != null && message.hasOwnProperty("width")) + if (!$util.isInteger(message.width)) + return "width: integer expected"; + if (message.mediaKey != null && message.hasOwnProperty("mediaKey")) + if (!(message.mediaKey && typeof message.mediaKey.length === "number" || $util.isString(message.mediaKey))) + return "mediaKey: buffer expected"; + if (message.fileEncSha256 != null && message.hasOwnProperty("fileEncSha256")) + if (!(message.fileEncSha256 && typeof message.fileEncSha256.length === "number" || $util.isString(message.fileEncSha256))) + return "fileEncSha256: buffer expected"; + if (message.interactiveAnnotations != null && message.hasOwnProperty("interactiveAnnotations")) { + if (!Array.isArray(message.interactiveAnnotations)) + return "interactiveAnnotations: array expected"; + for (var i = 0; i < message.interactiveAnnotations.length; ++i) { + var error = $root.proto.InteractiveAnnotation.verify(message.interactiveAnnotations[i]); + if (error) + return "interactiveAnnotations." + error; + } + } + if (message.directPath != null && message.hasOwnProperty("directPath")) + if (!$util.isString(message.directPath)) + return "directPath: string expected"; + if (message.mediaKeyTimestamp != null && message.hasOwnProperty("mediaKeyTimestamp")) + if (!$util.isInteger(message.mediaKeyTimestamp) && !(message.mediaKeyTimestamp && $util.isInteger(message.mediaKeyTimestamp.low) && $util.isInteger(message.mediaKeyTimestamp.high))) + return "mediaKeyTimestamp: integer|Long expected"; + if (message.jpegThumbnail != null && message.hasOwnProperty("jpegThumbnail")) + if (!(message.jpegThumbnail && typeof message.jpegThumbnail.length === "number" || $util.isString(message.jpegThumbnail))) + return "jpegThumbnail: buffer expected"; + if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) { + var error = $root.proto.ContextInfo.verify(message.contextInfo); + if (error) + return "contextInfo." + error; + } + if (message.firstScanSidecar != null && message.hasOwnProperty("firstScanSidecar")) + if (!(message.firstScanSidecar && typeof message.firstScanSidecar.length === "number" || $util.isString(message.firstScanSidecar))) + return "firstScanSidecar: buffer expected"; + if (message.firstScanLength != null && message.hasOwnProperty("firstScanLength")) + if (!$util.isInteger(message.firstScanLength)) + return "firstScanLength: integer expected"; + if (message.experimentGroupId != null && message.hasOwnProperty("experimentGroupId")) + if (!$util.isInteger(message.experimentGroupId)) + return "experimentGroupId: integer expected"; + if (message.scansSidecar != null && message.hasOwnProperty("scansSidecar")) + if (!(message.scansSidecar && typeof message.scansSidecar.length === "number" || $util.isString(message.scansSidecar))) + return "scansSidecar: buffer expected"; + if (message.scanLengths != null && message.hasOwnProperty("scanLengths")) { + if (!Array.isArray(message.scanLengths)) + return "scanLengths: array expected"; + for (var i = 0; i < message.scanLengths.length; ++i) + if (!$util.isInteger(message.scanLengths[i])) + return "scanLengths: integer[] expected"; + } + if (message.midQualityFileSha256 != null && message.hasOwnProperty("midQualityFileSha256")) + if (!(message.midQualityFileSha256 && typeof message.midQualityFileSha256.length === "number" || $util.isString(message.midQualityFileSha256))) + return "midQualityFileSha256: buffer expected"; + if (message.midQualityFileEncSha256 != null && message.hasOwnProperty("midQualityFileEncSha256")) + if (!(message.midQualityFileEncSha256 && typeof message.midQualityFileEncSha256.length === "number" || $util.isString(message.midQualityFileEncSha256))) + return "midQualityFileEncSha256: buffer expected"; + return null; + }; + + /** + * Creates an ImageMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.ImageMessage + * @static + * @param {Object.} object Plain object + * @returns {proto.ImageMessage} ImageMessage + */ + ImageMessage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.ImageMessage) + return object; + var message = new $root.proto.ImageMessage(); + if (object.url != null) + message.url = String(object.url); + if (object.mimetype != null) + message.mimetype = String(object.mimetype); + if (object.caption != null) + message.caption = String(object.caption); + if (object.fileSha256 != null) + if (typeof object.fileSha256 === "string") + $util.base64.decode(object.fileSha256, message.fileSha256 = $util.newBuffer($util.base64.length(object.fileSha256)), 0); + else if (object.fileSha256.length) + message.fileSha256 = object.fileSha256; + if (object.fileLength != null) + if ($util.Long) + (message.fileLength = $util.Long.fromValue(object.fileLength)).unsigned = true; + else if (typeof object.fileLength === "string") + message.fileLength = parseInt(object.fileLength, 10); + else if (typeof object.fileLength === "number") + message.fileLength = object.fileLength; + else if (typeof object.fileLength === "object") + message.fileLength = new $util.LongBits(object.fileLength.low >>> 0, object.fileLength.high >>> 0).toNumber(true); + if (object.height != null) + message.height = object.height >>> 0; + if (object.width != null) + message.width = object.width >>> 0; + if (object.mediaKey != null) + if (typeof object.mediaKey === "string") + $util.base64.decode(object.mediaKey, message.mediaKey = $util.newBuffer($util.base64.length(object.mediaKey)), 0); + else if (object.mediaKey.length) + message.mediaKey = object.mediaKey; + if (object.fileEncSha256 != null) + if (typeof object.fileEncSha256 === "string") + $util.base64.decode(object.fileEncSha256, message.fileEncSha256 = $util.newBuffer($util.base64.length(object.fileEncSha256)), 0); + else if (object.fileEncSha256.length) + message.fileEncSha256 = object.fileEncSha256; + if (object.interactiveAnnotations) { + if (!Array.isArray(object.interactiveAnnotations)) + throw TypeError(".proto.ImageMessage.interactiveAnnotations: array expected"); + message.interactiveAnnotations = []; + for (var i = 0; i < object.interactiveAnnotations.length; ++i) { + if (typeof object.interactiveAnnotations[i] !== "object") + throw TypeError(".proto.ImageMessage.interactiveAnnotations: object expected"); + message.interactiveAnnotations[i] = $root.proto.InteractiveAnnotation.fromObject(object.interactiveAnnotations[i]); + } + } + if (object.directPath != null) + message.directPath = String(object.directPath); + if (object.mediaKeyTimestamp != null) + if ($util.Long) + (message.mediaKeyTimestamp = $util.Long.fromValue(object.mediaKeyTimestamp)).unsigned = false; + else if (typeof object.mediaKeyTimestamp === "string") + message.mediaKeyTimestamp = parseInt(object.mediaKeyTimestamp, 10); + else if (typeof object.mediaKeyTimestamp === "number") + message.mediaKeyTimestamp = object.mediaKeyTimestamp; + else if (typeof object.mediaKeyTimestamp === "object") + message.mediaKeyTimestamp = new $util.LongBits(object.mediaKeyTimestamp.low >>> 0, object.mediaKeyTimestamp.high >>> 0).toNumber(); + if (object.jpegThumbnail != null) + if (typeof object.jpegThumbnail === "string") + $util.base64.decode(object.jpegThumbnail, message.jpegThumbnail = $util.newBuffer($util.base64.length(object.jpegThumbnail)), 0); + else if (object.jpegThumbnail.length) + message.jpegThumbnail = object.jpegThumbnail; + if (object.contextInfo != null) { + if (typeof object.contextInfo !== "object") + throw TypeError(".proto.ImageMessage.contextInfo: object expected"); + message.contextInfo = $root.proto.ContextInfo.fromObject(object.contextInfo); + } + if (object.firstScanSidecar != null) + if (typeof object.firstScanSidecar === "string") + $util.base64.decode(object.firstScanSidecar, message.firstScanSidecar = $util.newBuffer($util.base64.length(object.firstScanSidecar)), 0); + else if (object.firstScanSidecar.length) + message.firstScanSidecar = object.firstScanSidecar; + if (object.firstScanLength != null) + message.firstScanLength = object.firstScanLength >>> 0; + if (object.experimentGroupId != null) + message.experimentGroupId = object.experimentGroupId >>> 0; + if (object.scansSidecar != null) + if (typeof object.scansSidecar === "string") + $util.base64.decode(object.scansSidecar, message.scansSidecar = $util.newBuffer($util.base64.length(object.scansSidecar)), 0); + else if (object.scansSidecar.length) + message.scansSidecar = object.scansSidecar; + if (object.scanLengths) { + if (!Array.isArray(object.scanLengths)) + throw TypeError(".proto.ImageMessage.scanLengths: array expected"); + message.scanLengths = []; + for (var i = 0; i < object.scanLengths.length; ++i) + message.scanLengths[i] = object.scanLengths[i] >>> 0; + } + if (object.midQualityFileSha256 != null) + if (typeof object.midQualityFileSha256 === "string") + $util.base64.decode(object.midQualityFileSha256, message.midQualityFileSha256 = $util.newBuffer($util.base64.length(object.midQualityFileSha256)), 0); + else if (object.midQualityFileSha256.length) + message.midQualityFileSha256 = object.midQualityFileSha256; + if (object.midQualityFileEncSha256 != null) + if (typeof object.midQualityFileEncSha256 === "string") + $util.base64.decode(object.midQualityFileEncSha256, message.midQualityFileEncSha256 = $util.newBuffer($util.base64.length(object.midQualityFileEncSha256)), 0); + else if (object.midQualityFileEncSha256.length) + message.midQualityFileEncSha256 = object.midQualityFileEncSha256; + return message; + }; + + /** + * Creates a plain object from an ImageMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.ImageMessage + * @static + * @param {proto.ImageMessage} message ImageMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.interactiveAnnotations = []; + object.scanLengths = []; + } + if (options.defaults) { + object.url = ""; + object.mimetype = ""; + object.caption = ""; + if (options.bytes === String) + object.fileSha256 = ""; + else { + object.fileSha256 = []; + if (options.bytes !== Array) + object.fileSha256 = $util.newBuffer(object.fileSha256); + } + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.fileLength = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.fileLength = options.longs === String ? "0" : 0; + object.height = 0; + object.width = 0; + if (options.bytes === String) + object.mediaKey = ""; + else { + object.mediaKey = []; + if (options.bytes !== Array) + object.mediaKey = $util.newBuffer(object.mediaKey); + } + if (options.bytes === String) + object.fileEncSha256 = ""; + else { + object.fileEncSha256 = []; + if (options.bytes !== Array) + object.fileEncSha256 = $util.newBuffer(object.fileEncSha256); + } + object.directPath = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.mediaKeyTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.mediaKeyTimestamp = options.longs === String ? "0" : 0; + if (options.bytes === String) + object.jpegThumbnail = ""; + else { + object.jpegThumbnail = []; + if (options.bytes !== Array) + object.jpegThumbnail = $util.newBuffer(object.jpegThumbnail); + } + object.contextInfo = null; + if (options.bytes === String) + object.firstScanSidecar = ""; + else { + object.firstScanSidecar = []; + if (options.bytes !== Array) + object.firstScanSidecar = $util.newBuffer(object.firstScanSidecar); + } + object.firstScanLength = 0; + object.experimentGroupId = 0; + if (options.bytes === String) + object.scansSidecar = ""; + else { + object.scansSidecar = []; + if (options.bytes !== Array) + object.scansSidecar = $util.newBuffer(object.scansSidecar); + } + if (options.bytes === String) + object.midQualityFileSha256 = ""; + else { + object.midQualityFileSha256 = []; + if (options.bytes !== Array) + object.midQualityFileSha256 = $util.newBuffer(object.midQualityFileSha256); + } + if (options.bytes === String) + object.midQualityFileEncSha256 = ""; + else { + object.midQualityFileEncSha256 = []; + if (options.bytes !== Array) + object.midQualityFileEncSha256 = $util.newBuffer(object.midQualityFileEncSha256); + } + } + if (message.url != null && message.hasOwnProperty("url")) + object.url = message.url; + if (message.mimetype != null && message.hasOwnProperty("mimetype")) + object.mimetype = message.mimetype; + if (message.caption != null && message.hasOwnProperty("caption")) + object.caption = message.caption; + if (message.fileSha256 != null && message.hasOwnProperty("fileSha256")) + object.fileSha256 = options.bytes === String ? $util.base64.encode(message.fileSha256, 0, message.fileSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.fileSha256) : message.fileSha256; + if (message.fileLength != null && message.hasOwnProperty("fileLength")) + if (typeof message.fileLength === "number") + object.fileLength = options.longs === String ? String(message.fileLength) : message.fileLength; + else + object.fileLength = options.longs === String ? $util.Long.prototype.toString.call(message.fileLength) : options.longs === Number ? new $util.LongBits(message.fileLength.low >>> 0, message.fileLength.high >>> 0).toNumber(true) : message.fileLength; + if (message.height != null && message.hasOwnProperty("height")) + object.height = message.height; + if (message.width != null && message.hasOwnProperty("width")) + object.width = message.width; + if (message.mediaKey != null && message.hasOwnProperty("mediaKey")) + object.mediaKey = options.bytes === String ? $util.base64.encode(message.mediaKey, 0, message.mediaKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.mediaKey) : message.mediaKey; + if (message.fileEncSha256 != null && message.hasOwnProperty("fileEncSha256")) + object.fileEncSha256 = options.bytes === String ? $util.base64.encode(message.fileEncSha256, 0, message.fileEncSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.fileEncSha256) : message.fileEncSha256; + if (message.interactiveAnnotations && message.interactiveAnnotations.length) { + object.interactiveAnnotations = []; + for (var j = 0; j < message.interactiveAnnotations.length; ++j) + object.interactiveAnnotations[j] = $root.proto.InteractiveAnnotation.toObject(message.interactiveAnnotations[j], options); + } + if (message.directPath != null && message.hasOwnProperty("directPath")) + object.directPath = message.directPath; + if (message.mediaKeyTimestamp != null && message.hasOwnProperty("mediaKeyTimestamp")) + if (typeof message.mediaKeyTimestamp === "number") + object.mediaKeyTimestamp = options.longs === String ? String(message.mediaKeyTimestamp) : message.mediaKeyTimestamp; + else + object.mediaKeyTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.mediaKeyTimestamp) : options.longs === Number ? new $util.LongBits(message.mediaKeyTimestamp.low >>> 0, message.mediaKeyTimestamp.high >>> 0).toNumber() : message.mediaKeyTimestamp; + if (message.jpegThumbnail != null && message.hasOwnProperty("jpegThumbnail")) + object.jpegThumbnail = options.bytes === String ? $util.base64.encode(message.jpegThumbnail, 0, message.jpegThumbnail.length) : options.bytes === Array ? Array.prototype.slice.call(message.jpegThumbnail) : message.jpegThumbnail; + if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) + object.contextInfo = $root.proto.ContextInfo.toObject(message.contextInfo, options); + if (message.firstScanSidecar != null && message.hasOwnProperty("firstScanSidecar")) + object.firstScanSidecar = options.bytes === String ? $util.base64.encode(message.firstScanSidecar, 0, message.firstScanSidecar.length) : options.bytes === Array ? Array.prototype.slice.call(message.firstScanSidecar) : message.firstScanSidecar; + if (message.firstScanLength != null && message.hasOwnProperty("firstScanLength")) + object.firstScanLength = message.firstScanLength; + if (message.experimentGroupId != null && message.hasOwnProperty("experimentGroupId")) + object.experimentGroupId = message.experimentGroupId; + if (message.scansSidecar != null && message.hasOwnProperty("scansSidecar")) + object.scansSidecar = options.bytes === String ? $util.base64.encode(message.scansSidecar, 0, message.scansSidecar.length) : options.bytes === Array ? Array.prototype.slice.call(message.scansSidecar) : message.scansSidecar; + if (message.scanLengths && message.scanLengths.length) { + object.scanLengths = []; + for (var j = 0; j < message.scanLengths.length; ++j) + object.scanLengths[j] = message.scanLengths[j]; + } + if (message.midQualityFileSha256 != null && message.hasOwnProperty("midQualityFileSha256")) + object.midQualityFileSha256 = options.bytes === String ? $util.base64.encode(message.midQualityFileSha256, 0, message.midQualityFileSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.midQualityFileSha256) : message.midQualityFileSha256; + if (message.midQualityFileEncSha256 != null && message.hasOwnProperty("midQualityFileEncSha256")) + object.midQualityFileEncSha256 = options.bytes === String ? $util.base64.encode(message.midQualityFileEncSha256, 0, message.midQualityFileEncSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.midQualityFileEncSha256) : message.midQualityFileEncSha256; + return object; + }; + + /** + * Converts this ImageMessage to JSON. + * @function toJSON + * @memberof proto.ImageMessage + * @instance + * @returns {Object.} JSON object + */ + ImageMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ImageMessage; + })(); + + proto.ContactMessage = (function() { + + /** + * Properties of a ContactMessage. + * @memberof proto + * @interface IContactMessage + * @property {string|null} [displayName] ContactMessage displayName + * @property {string|null} [vcard] ContactMessage vcard + * @property {proto.IContextInfo|null} [contextInfo] ContactMessage contextInfo + */ + + /** + * Constructs a new ContactMessage. + * @memberof proto + * @classdesc Represents a ContactMessage. + * @implements IContactMessage + * @constructor + * @param {proto.IContactMessage=} [properties] Properties to set + */ + function ContactMessage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ContactMessage displayName. + * @member {string} displayName + * @memberof proto.ContactMessage + * @instance + */ + ContactMessage.prototype.displayName = ""; + + /** + * ContactMessage vcard. + * @member {string} vcard + * @memberof proto.ContactMessage + * @instance + */ + ContactMessage.prototype.vcard = ""; + + /** + * ContactMessage contextInfo. + * @member {proto.IContextInfo|null|undefined} contextInfo + * @memberof proto.ContactMessage + * @instance + */ + ContactMessage.prototype.contextInfo = null; + + /** + * Creates a new ContactMessage instance using the specified properties. + * @function create + * @memberof proto.ContactMessage + * @static + * @param {proto.IContactMessage=} [properties] Properties to set + * @returns {proto.ContactMessage} ContactMessage instance + */ + ContactMessage.create = function create(properties) { + return new ContactMessage(properties); + }; + + /** + * Encodes the specified ContactMessage message. Does not implicitly {@link proto.ContactMessage.verify|verify} messages. + * @function encode + * @memberof proto.ContactMessage + * @static + * @param {proto.IContactMessage} message ContactMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContactMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayName); + if (message.vcard != null && Object.hasOwnProperty.call(message, "vcard")) + writer.uint32(/* id 16, wireType 2 =*/130).string(message.vcard); + if (message.contextInfo != null && Object.hasOwnProperty.call(message, "contextInfo")) + $root.proto.ContextInfo.encode(message.contextInfo, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ContactMessage message, length delimited. Does not implicitly {@link proto.ContactMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.ContactMessage + * @static + * @param {proto.IContactMessage} message ContactMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContactMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContactMessage message from the specified reader or buffer. + * @function decode + * @memberof proto.ContactMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.ContactMessage} ContactMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContactMessage.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ContactMessage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.displayName = reader.string(); + break; + case 16: + message.vcard = reader.string(); + break; + case 17: + message.contextInfo = $root.proto.ContextInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContactMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.ContactMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.ContactMessage} ContactMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContactMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContactMessage message. + * @function verify + * @memberof proto.ContactMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContactMessage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.vcard != null && message.hasOwnProperty("vcard")) + if (!$util.isString(message.vcard)) + return "vcard: string expected"; + if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) { + var error = $root.proto.ContextInfo.verify(message.contextInfo); + if (error) + return "contextInfo." + error; + } + return null; + }; + + /** + * Creates a ContactMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.ContactMessage + * @static + * @param {Object.} object Plain object + * @returns {proto.ContactMessage} ContactMessage + */ + ContactMessage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.ContactMessage) + return object; + var message = new $root.proto.ContactMessage(); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.vcard != null) + message.vcard = String(object.vcard); + if (object.contextInfo != null) { + if (typeof object.contextInfo !== "object") + throw TypeError(".proto.ContactMessage.contextInfo: object expected"); + message.contextInfo = $root.proto.ContextInfo.fromObject(object.contextInfo); + } + return message; + }; + + /** + * Creates a plain object from a ContactMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.ContactMessage + * @static + * @param {proto.ContactMessage} message ContactMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContactMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.displayName = ""; + object.vcard = ""; + object.contextInfo = null; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.vcard != null && message.hasOwnProperty("vcard")) + object.vcard = message.vcard; + if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) + object.contextInfo = $root.proto.ContextInfo.toObject(message.contextInfo, options); + return object; + }; + + /** + * Converts this ContactMessage to JSON. + * @function toJSON + * @memberof proto.ContactMessage + * @instance + * @returns {Object.} JSON object + */ + ContactMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ContactMessage; + })(); + + proto.LocationMessage = (function() { + + /** + * Properties of a LocationMessage. + * @memberof proto + * @interface ILocationMessage + * @property {number|null} [degreesLatitude] LocationMessage degreesLatitude + * @property {number|null} [degreesLongitude] LocationMessage degreesLongitude + * @property {string|null} [name] LocationMessage name + * @property {string|null} [address] LocationMessage address + * @property {string|null} [url] LocationMessage url + * @property {Uint8Array|null} [jpegThumbnail] LocationMessage jpegThumbnail + * @property {proto.IContextInfo|null} [contextInfo] LocationMessage contextInfo + */ + + /** + * Constructs a new LocationMessage. + * @memberof proto + * @classdesc Represents a LocationMessage. + * @implements ILocationMessage + * @constructor + * @param {proto.ILocationMessage=} [properties] Properties to set + */ + function LocationMessage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LocationMessage degreesLatitude. + * @member {number} degreesLatitude + * @memberof proto.LocationMessage + * @instance + */ + LocationMessage.prototype.degreesLatitude = 0; + + /** + * LocationMessage degreesLongitude. + * @member {number} degreesLongitude + * @memberof proto.LocationMessage + * @instance + */ + LocationMessage.prototype.degreesLongitude = 0; + + /** + * LocationMessage name. + * @member {string} name + * @memberof proto.LocationMessage + * @instance + */ + LocationMessage.prototype.name = ""; + + /** + * LocationMessage address. + * @member {string} address + * @memberof proto.LocationMessage + * @instance + */ + LocationMessage.prototype.address = ""; + + /** + * LocationMessage url. + * @member {string} url + * @memberof proto.LocationMessage + * @instance + */ + LocationMessage.prototype.url = ""; + + /** + * LocationMessage jpegThumbnail. + * @member {Uint8Array} jpegThumbnail + * @memberof proto.LocationMessage + * @instance + */ + LocationMessage.prototype.jpegThumbnail = $util.newBuffer([]); + + /** + * LocationMessage contextInfo. + * @member {proto.IContextInfo|null|undefined} contextInfo + * @memberof proto.LocationMessage + * @instance + */ + LocationMessage.prototype.contextInfo = null; + + /** + * Creates a new LocationMessage instance using the specified properties. + * @function create + * @memberof proto.LocationMessage + * @static + * @param {proto.ILocationMessage=} [properties] Properties to set + * @returns {proto.LocationMessage} LocationMessage instance + */ + LocationMessage.create = function create(properties) { + return new LocationMessage(properties); + }; + + /** + * Encodes the specified LocationMessage message. Does not implicitly {@link proto.LocationMessage.verify|verify} messages. + * @function encode + * @memberof proto.LocationMessage + * @static + * @param {proto.ILocationMessage} message LocationMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocationMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.degreesLatitude != null && Object.hasOwnProperty.call(message, "degreesLatitude")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.degreesLatitude); + if (message.degreesLongitude != null && Object.hasOwnProperty.call(message, "degreesLongitude")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.degreesLongitude); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); + if (message.address != null && Object.hasOwnProperty.call(message, "address")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.address); + if (message.url != null && Object.hasOwnProperty.call(message, "url")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.url); + if (message.jpegThumbnail != null && Object.hasOwnProperty.call(message, "jpegThumbnail")) + writer.uint32(/* id 16, wireType 2 =*/130).bytes(message.jpegThumbnail); + if (message.contextInfo != null && Object.hasOwnProperty.call(message, "contextInfo")) + $root.proto.ContextInfo.encode(message.contextInfo, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LocationMessage message, length delimited. Does not implicitly {@link proto.LocationMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.LocationMessage + * @static + * @param {proto.ILocationMessage} message LocationMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocationMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LocationMessage message from the specified reader or buffer. + * @function decode + * @memberof proto.LocationMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.LocationMessage} LocationMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocationMessage.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.LocationMessage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.degreesLatitude = reader.double(); + break; + case 2: + message.degreesLongitude = reader.double(); + break; + case 3: + message.name = reader.string(); + break; + case 4: + message.address = reader.string(); + break; + case 5: + message.url = reader.string(); + break; + case 16: + message.jpegThumbnail = reader.bytes(); + break; + case 17: + message.contextInfo = $root.proto.ContextInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LocationMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.LocationMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.LocationMessage} LocationMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocationMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LocationMessage message. + * @function verify + * @memberof proto.LocationMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LocationMessage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.degreesLatitude != null && message.hasOwnProperty("degreesLatitude")) + if (typeof message.degreesLatitude !== "number") + return "degreesLatitude: number expected"; + if (message.degreesLongitude != null && message.hasOwnProperty("degreesLongitude")) + if (typeof message.degreesLongitude !== "number") + return "degreesLongitude: number expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.address != null && message.hasOwnProperty("address")) + if (!$util.isString(message.address)) + return "address: string expected"; + if (message.url != null && message.hasOwnProperty("url")) + if (!$util.isString(message.url)) + return "url: string expected"; + if (message.jpegThumbnail != null && message.hasOwnProperty("jpegThumbnail")) + if (!(message.jpegThumbnail && typeof message.jpegThumbnail.length === "number" || $util.isString(message.jpegThumbnail))) + return "jpegThumbnail: buffer expected"; + if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) { + var error = $root.proto.ContextInfo.verify(message.contextInfo); + if (error) + return "contextInfo." + error; + } + return null; + }; + + /** + * Creates a LocationMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.LocationMessage + * @static + * @param {Object.} object Plain object + * @returns {proto.LocationMessage} LocationMessage + */ + LocationMessage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.LocationMessage) + return object; + var message = new $root.proto.LocationMessage(); + if (object.degreesLatitude != null) + message.degreesLatitude = Number(object.degreesLatitude); + if (object.degreesLongitude != null) + message.degreesLongitude = Number(object.degreesLongitude); + if (object.name != null) + message.name = String(object.name); + if (object.address != null) + message.address = String(object.address); + if (object.url != null) + message.url = String(object.url); + if (object.jpegThumbnail != null) + if (typeof object.jpegThumbnail === "string") + $util.base64.decode(object.jpegThumbnail, message.jpegThumbnail = $util.newBuffer($util.base64.length(object.jpegThumbnail)), 0); + else if (object.jpegThumbnail.length) + message.jpegThumbnail = object.jpegThumbnail; + if (object.contextInfo != null) { + if (typeof object.contextInfo !== "object") + throw TypeError(".proto.LocationMessage.contextInfo: object expected"); + message.contextInfo = $root.proto.ContextInfo.fromObject(object.contextInfo); + } + return message; + }; + + /** + * Creates a plain object from a LocationMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.LocationMessage + * @static + * @param {proto.LocationMessage} message LocationMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LocationMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.degreesLatitude = 0; + object.degreesLongitude = 0; + object.name = ""; + object.address = ""; + object.url = ""; + if (options.bytes === String) + object.jpegThumbnail = ""; + else { + object.jpegThumbnail = []; + if (options.bytes !== Array) + object.jpegThumbnail = $util.newBuffer(object.jpegThumbnail); + } + object.contextInfo = null; + } + if (message.degreesLatitude != null && message.hasOwnProperty("degreesLatitude")) + object.degreesLatitude = options.json && !isFinite(message.degreesLatitude) ? String(message.degreesLatitude) : message.degreesLatitude; + if (message.degreesLongitude != null && message.hasOwnProperty("degreesLongitude")) + object.degreesLongitude = options.json && !isFinite(message.degreesLongitude) ? String(message.degreesLongitude) : message.degreesLongitude; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.address != null && message.hasOwnProperty("address")) + object.address = message.address; + if (message.url != null && message.hasOwnProperty("url")) + object.url = message.url; + if (message.jpegThumbnail != null && message.hasOwnProperty("jpegThumbnail")) + object.jpegThumbnail = options.bytes === String ? $util.base64.encode(message.jpegThumbnail, 0, message.jpegThumbnail.length) : options.bytes === Array ? Array.prototype.slice.call(message.jpegThumbnail) : message.jpegThumbnail; + if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) + object.contextInfo = $root.proto.ContextInfo.toObject(message.contextInfo, options); + return object; + }; + + /** + * Converts this LocationMessage to JSON. + * @function toJSON + * @memberof proto.LocationMessage + * @instance + * @returns {Object.} JSON object + */ + LocationMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return LocationMessage; + })(); + + proto.ExtendedTextMessage = (function() { + + /** + * Properties of an ExtendedTextMessage. + * @memberof proto + * @interface IExtendedTextMessage + * @property {string|null} [text] ExtendedTextMessage text + * @property {string|null} [matchedText] ExtendedTextMessage matchedText + * @property {string|null} [canonicalUrl] ExtendedTextMessage canonicalUrl + * @property {string|null} [description] ExtendedTextMessage description + * @property {string|null} [title] ExtendedTextMessage title + * @property {number|null} [textArgb] ExtendedTextMessage textArgb + * @property {number|null} [backgroundArgb] ExtendedTextMessage backgroundArgb + * @property {proto.ExtendedTextMessage.EXTENDED_TEXT_MESSAGE_FONTTYPE|null} [font] ExtendedTextMessage font + * @property {proto.ExtendedTextMessage.EXTENDED_TEXT_MESSAGE_PREVIEWTYPE|null} [previewType] ExtendedTextMessage previewType + * @property {Uint8Array|null} [jpegThumbnail] ExtendedTextMessage jpegThumbnail + * @property {proto.IContextInfo|null} [contextInfo] ExtendedTextMessage contextInfo + * @property {boolean|null} [doNotPlayInline] ExtendedTextMessage doNotPlayInline + */ + + /** + * Constructs a new ExtendedTextMessage. + * @memberof proto + * @classdesc Represents an ExtendedTextMessage. + * @implements IExtendedTextMessage + * @constructor + * @param {proto.IExtendedTextMessage=} [properties] Properties to set + */ + function ExtendedTextMessage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtendedTextMessage text. + * @member {string} text + * @memberof proto.ExtendedTextMessage + * @instance + */ + ExtendedTextMessage.prototype.text = ""; + + /** + * ExtendedTextMessage matchedText. + * @member {string} matchedText + * @memberof proto.ExtendedTextMessage + * @instance + */ + ExtendedTextMessage.prototype.matchedText = ""; + + /** + * ExtendedTextMessage canonicalUrl. + * @member {string} canonicalUrl + * @memberof proto.ExtendedTextMessage + * @instance + */ + ExtendedTextMessage.prototype.canonicalUrl = ""; + + /** + * ExtendedTextMessage description. + * @member {string} description + * @memberof proto.ExtendedTextMessage + * @instance + */ + ExtendedTextMessage.prototype.description = ""; + + /** + * ExtendedTextMessage title. + * @member {string} title + * @memberof proto.ExtendedTextMessage + * @instance + */ + ExtendedTextMessage.prototype.title = ""; + + /** + * ExtendedTextMessage textArgb. + * @member {number} textArgb + * @memberof proto.ExtendedTextMessage + * @instance + */ + ExtendedTextMessage.prototype.textArgb = 0; + + /** + * ExtendedTextMessage backgroundArgb. + * @member {number} backgroundArgb + * @memberof proto.ExtendedTextMessage + * @instance + */ + ExtendedTextMessage.prototype.backgroundArgb = 0; + + /** + * ExtendedTextMessage font. + * @member {proto.ExtendedTextMessage.EXTENDED_TEXT_MESSAGE_FONTTYPE} font + * @memberof proto.ExtendedTextMessage + * @instance + */ + ExtendedTextMessage.prototype.font = 0; + + /** + * ExtendedTextMessage previewType. + * @member {proto.ExtendedTextMessage.EXTENDED_TEXT_MESSAGE_PREVIEWTYPE} previewType + * @memberof proto.ExtendedTextMessage + * @instance + */ + ExtendedTextMessage.prototype.previewType = 0; + + /** + * ExtendedTextMessage jpegThumbnail. + * @member {Uint8Array} jpegThumbnail + * @memberof proto.ExtendedTextMessage + * @instance + */ + ExtendedTextMessage.prototype.jpegThumbnail = $util.newBuffer([]); + + /** + * ExtendedTextMessage contextInfo. + * @member {proto.IContextInfo|null|undefined} contextInfo + * @memberof proto.ExtendedTextMessage + * @instance + */ + ExtendedTextMessage.prototype.contextInfo = null; + + /** + * ExtendedTextMessage doNotPlayInline. + * @member {boolean} doNotPlayInline + * @memberof proto.ExtendedTextMessage + * @instance + */ + ExtendedTextMessage.prototype.doNotPlayInline = false; + + /** + * Creates a new ExtendedTextMessage instance using the specified properties. + * @function create + * @memberof proto.ExtendedTextMessage + * @static + * @param {proto.IExtendedTextMessage=} [properties] Properties to set + * @returns {proto.ExtendedTextMessage} ExtendedTextMessage instance + */ + ExtendedTextMessage.create = function create(properties) { + return new ExtendedTextMessage(properties); + }; + + /** + * Encodes the specified ExtendedTextMessage message. Does not implicitly {@link proto.ExtendedTextMessage.verify|verify} messages. + * @function encode + * @memberof proto.ExtendedTextMessage + * @static + * @param {proto.IExtendedTextMessage} message ExtendedTextMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtendedTextMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + if (message.matchedText != null && Object.hasOwnProperty.call(message, "matchedText")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.matchedText); + if (message.canonicalUrl != null && Object.hasOwnProperty.call(message, "canonicalUrl")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.canonicalUrl); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.title); + if (message.textArgb != null && Object.hasOwnProperty.call(message, "textArgb")) + writer.uint32(/* id 7, wireType 5 =*/61).fixed32(message.textArgb); + if (message.backgroundArgb != null && Object.hasOwnProperty.call(message, "backgroundArgb")) + writer.uint32(/* id 8, wireType 5 =*/69).fixed32(message.backgroundArgb); + if (message.font != null && Object.hasOwnProperty.call(message, "font")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.font); + if (message.previewType != null && Object.hasOwnProperty.call(message, "previewType")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.previewType); + if (message.jpegThumbnail != null && Object.hasOwnProperty.call(message, "jpegThumbnail")) + writer.uint32(/* id 16, wireType 2 =*/130).bytes(message.jpegThumbnail); + if (message.contextInfo != null && Object.hasOwnProperty.call(message, "contextInfo")) + $root.proto.ContextInfo.encode(message.contextInfo, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.doNotPlayInline != null && Object.hasOwnProperty.call(message, "doNotPlayInline")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.doNotPlayInline); + return writer; + }; + + /** + * Encodes the specified ExtendedTextMessage message, length delimited. Does not implicitly {@link proto.ExtendedTextMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.ExtendedTextMessage + * @static + * @param {proto.IExtendedTextMessage} message ExtendedTextMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtendedTextMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtendedTextMessage message from the specified reader or buffer. + * @function decode + * @memberof proto.ExtendedTextMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.ExtendedTextMessage} ExtendedTextMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtendedTextMessage.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ExtendedTextMessage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.text = reader.string(); + break; + case 2: + message.matchedText = reader.string(); + break; + case 4: + message.canonicalUrl = reader.string(); + break; + case 5: + message.description = reader.string(); + break; + case 6: + message.title = reader.string(); + break; + case 7: + message.textArgb = reader.fixed32(); + break; + case 8: + message.backgroundArgb = reader.fixed32(); + break; + case 9: + message.font = reader.int32(); + break; + case 10: + message.previewType = reader.int32(); + break; + case 16: + message.jpegThumbnail = reader.bytes(); + break; + case 17: + message.contextInfo = $root.proto.ContextInfo.decode(reader, reader.uint32()); + break; + case 18: + message.doNotPlayInline = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtendedTextMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.ExtendedTextMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.ExtendedTextMessage} ExtendedTextMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtendedTextMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtendedTextMessage message. + * @function verify + * @memberof proto.ExtendedTextMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtendedTextMessage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + if (message.matchedText != null && message.hasOwnProperty("matchedText")) + if (!$util.isString(message.matchedText)) + return "matchedText: string expected"; + if (message.canonicalUrl != null && message.hasOwnProperty("canonicalUrl")) + if (!$util.isString(message.canonicalUrl)) + return "canonicalUrl: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.textArgb != null && message.hasOwnProperty("textArgb")) + if (!$util.isInteger(message.textArgb)) + return "textArgb: integer expected"; + if (message.backgroundArgb != null && message.hasOwnProperty("backgroundArgb")) + if (!$util.isInteger(message.backgroundArgb)) + return "backgroundArgb: integer expected"; + if (message.font != null && message.hasOwnProperty("font")) + switch (message.font) { + default: + return "font: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.previewType != null && message.hasOwnProperty("previewType")) + switch (message.previewType) { + default: + return "previewType: enum value expected"; + case 0: + case 1: + break; + } + if (message.jpegThumbnail != null && message.hasOwnProperty("jpegThumbnail")) + if (!(message.jpegThumbnail && typeof message.jpegThumbnail.length === "number" || $util.isString(message.jpegThumbnail))) + return "jpegThumbnail: buffer expected"; + if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) { + var error = $root.proto.ContextInfo.verify(message.contextInfo); + if (error) + return "contextInfo." + error; + } + if (message.doNotPlayInline != null && message.hasOwnProperty("doNotPlayInline")) + if (typeof message.doNotPlayInline !== "boolean") + return "doNotPlayInline: boolean expected"; + return null; + }; + + /** + * Creates an ExtendedTextMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.ExtendedTextMessage + * @static + * @param {Object.} object Plain object + * @returns {proto.ExtendedTextMessage} ExtendedTextMessage + */ + ExtendedTextMessage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.ExtendedTextMessage) + return object; + var message = new $root.proto.ExtendedTextMessage(); + if (object.text != null) + message.text = String(object.text); + if (object.matchedText != null) + message.matchedText = String(object.matchedText); + if (object.canonicalUrl != null) + message.canonicalUrl = String(object.canonicalUrl); + if (object.description != null) + message.description = String(object.description); + if (object.title != null) + message.title = String(object.title); + if (object.textArgb != null) + message.textArgb = object.textArgb >>> 0; + if (object.backgroundArgb != null) + message.backgroundArgb = object.backgroundArgb >>> 0; + switch (object.font) { + case "SANS_SERIF": + case 0: + message.font = 0; + break; + case "SERIF": + case 1: + message.font = 1; + break; + case "NORICAN_REGULAR": + case 2: + message.font = 2; + break; + case "BRYNDAN_WRITE": + case 3: + message.font = 3; + break; + case "BEBASNEUE_REGULAR": + case 4: + message.font = 4; + break; + case "OSWALD_HEAVY": + case 5: + message.font = 5; + break; + } + switch (object.previewType) { + case "NONE": + case 0: + message.previewType = 0; + break; + case "VIDEO": + case 1: + message.previewType = 1; + break; + } + if (object.jpegThumbnail != null) + if (typeof object.jpegThumbnail === "string") + $util.base64.decode(object.jpegThumbnail, message.jpegThumbnail = $util.newBuffer($util.base64.length(object.jpegThumbnail)), 0); + else if (object.jpegThumbnail.length) + message.jpegThumbnail = object.jpegThumbnail; + if (object.contextInfo != null) { + if (typeof object.contextInfo !== "object") + throw TypeError(".proto.ExtendedTextMessage.contextInfo: object expected"); + message.contextInfo = $root.proto.ContextInfo.fromObject(object.contextInfo); + } + if (object.doNotPlayInline != null) + message.doNotPlayInline = Boolean(object.doNotPlayInline); + return message; + }; + + /** + * Creates a plain object from an ExtendedTextMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.ExtendedTextMessage + * @static + * @param {proto.ExtendedTextMessage} message ExtendedTextMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtendedTextMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.text = ""; + object.matchedText = ""; + object.canonicalUrl = ""; + object.description = ""; + object.title = ""; + object.textArgb = 0; + object.backgroundArgb = 0; + object.font = options.enums === String ? "SANS_SERIF" : 0; + object.previewType = options.enums === String ? "NONE" : 0; + if (options.bytes === String) + object.jpegThumbnail = ""; + else { + object.jpegThumbnail = []; + if (options.bytes !== Array) + object.jpegThumbnail = $util.newBuffer(object.jpegThumbnail); + } + object.contextInfo = null; + object.doNotPlayInline = false; + } + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + if (message.matchedText != null && message.hasOwnProperty("matchedText")) + object.matchedText = message.matchedText; + if (message.canonicalUrl != null && message.hasOwnProperty("canonicalUrl")) + object.canonicalUrl = message.canonicalUrl; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.textArgb != null && message.hasOwnProperty("textArgb")) + object.textArgb = message.textArgb; + if (message.backgroundArgb != null && message.hasOwnProperty("backgroundArgb")) + object.backgroundArgb = message.backgroundArgb; + if (message.font != null && message.hasOwnProperty("font")) + object.font = options.enums === String ? $root.proto.ExtendedTextMessage.EXTENDED_TEXT_MESSAGE_FONTTYPE[message.font] : message.font; + if (message.previewType != null && message.hasOwnProperty("previewType")) + object.previewType = options.enums === String ? $root.proto.ExtendedTextMessage.EXTENDED_TEXT_MESSAGE_PREVIEWTYPE[message.previewType] : message.previewType; + if (message.jpegThumbnail != null && message.hasOwnProperty("jpegThumbnail")) + object.jpegThumbnail = options.bytes === String ? $util.base64.encode(message.jpegThumbnail, 0, message.jpegThumbnail.length) : options.bytes === Array ? Array.prototype.slice.call(message.jpegThumbnail) : message.jpegThumbnail; + if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) + object.contextInfo = $root.proto.ContextInfo.toObject(message.contextInfo, options); + if (message.doNotPlayInline != null && message.hasOwnProperty("doNotPlayInline")) + object.doNotPlayInline = message.doNotPlayInline; + return object; + }; + + /** + * Converts this ExtendedTextMessage to JSON. + * @function toJSON + * @memberof proto.ExtendedTextMessage + * @instance + * @returns {Object.} JSON object + */ + ExtendedTextMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * EXTENDED_TEXT_MESSAGE_FONTTYPE enum. + * @name proto.ExtendedTextMessage.EXTENDED_TEXT_MESSAGE_FONTTYPE + * @enum {number} + * @property {number} SANS_SERIF=0 SANS_SERIF value + * @property {number} SERIF=1 SERIF value + * @property {number} NORICAN_REGULAR=2 NORICAN_REGULAR value + * @property {number} BRYNDAN_WRITE=3 BRYNDAN_WRITE value + * @property {number} BEBASNEUE_REGULAR=4 BEBASNEUE_REGULAR value + * @property {number} OSWALD_HEAVY=5 OSWALD_HEAVY value + */ + ExtendedTextMessage.EXTENDED_TEXT_MESSAGE_FONTTYPE = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SANS_SERIF"] = 0; + values[valuesById[1] = "SERIF"] = 1; + values[valuesById[2] = "NORICAN_REGULAR"] = 2; + values[valuesById[3] = "BRYNDAN_WRITE"] = 3; + values[valuesById[4] = "BEBASNEUE_REGULAR"] = 4; + values[valuesById[5] = "OSWALD_HEAVY"] = 5; + return values; + })(); + + /** + * EXTENDED_TEXT_MESSAGE_PREVIEWTYPE enum. + * @name proto.ExtendedTextMessage.EXTENDED_TEXT_MESSAGE_PREVIEWTYPE + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} VIDEO=1 VIDEO value + */ + ExtendedTextMessage.EXTENDED_TEXT_MESSAGE_PREVIEWTYPE = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "VIDEO"] = 1; + return values; + })(); + + return ExtendedTextMessage; + })(); + + proto.DocumentMessage = (function() { + + /** + * Properties of a DocumentMessage. + * @memberof proto + * @interface IDocumentMessage + * @property {string|null} [url] DocumentMessage url + * @property {string|null} [mimetype] DocumentMessage mimetype + * @property {string|null} [title] DocumentMessage title + * @property {Uint8Array|null} [fileSha256] DocumentMessage fileSha256 + * @property {number|Long|null} [fileLength] DocumentMessage fileLength + * @property {number|null} [pageCount] DocumentMessage pageCount + * @property {Uint8Array|null} [mediaKey] DocumentMessage mediaKey + * @property {string|null} [fileName] DocumentMessage fileName + * @property {Uint8Array|null} [fileEncSha256] DocumentMessage fileEncSha256 + * @property {string|null} [directPath] DocumentMessage directPath + * @property {number|Long|null} [mediaKeyTimestamp] DocumentMessage mediaKeyTimestamp + * @property {Uint8Array|null} [jpegThumbnail] DocumentMessage jpegThumbnail + * @property {proto.IContextInfo|null} [contextInfo] DocumentMessage contextInfo + */ + + /** + * Constructs a new DocumentMessage. + * @memberof proto + * @classdesc Represents a DocumentMessage. + * @implements IDocumentMessage + * @constructor + * @param {proto.IDocumentMessage=} [properties] Properties to set + */ + function DocumentMessage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DocumentMessage url. + * @member {string} url + * @memberof proto.DocumentMessage + * @instance + */ + DocumentMessage.prototype.url = ""; + + /** + * DocumentMessage mimetype. + * @member {string} mimetype + * @memberof proto.DocumentMessage + * @instance + */ + DocumentMessage.prototype.mimetype = ""; + + /** + * DocumentMessage title. + * @member {string} title + * @memberof proto.DocumentMessage + * @instance + */ + DocumentMessage.prototype.title = ""; + + /** + * DocumentMessage fileSha256. + * @member {Uint8Array} fileSha256 + * @memberof proto.DocumentMessage + * @instance + */ + DocumentMessage.prototype.fileSha256 = $util.newBuffer([]); + + /** + * DocumentMessage fileLength. + * @member {number|Long} fileLength + * @memberof proto.DocumentMessage + * @instance + */ + DocumentMessage.prototype.fileLength = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * DocumentMessage pageCount. + * @member {number} pageCount + * @memberof proto.DocumentMessage + * @instance + */ + DocumentMessage.prototype.pageCount = 0; + + /** + * DocumentMessage mediaKey. + * @member {Uint8Array} mediaKey + * @memberof proto.DocumentMessage + * @instance + */ + DocumentMessage.prototype.mediaKey = $util.newBuffer([]); + + /** + * DocumentMessage fileName. + * @member {string} fileName + * @memberof proto.DocumentMessage + * @instance + */ + DocumentMessage.prototype.fileName = ""; + + /** + * DocumentMessage fileEncSha256. + * @member {Uint8Array} fileEncSha256 + * @memberof proto.DocumentMessage + * @instance + */ + DocumentMessage.prototype.fileEncSha256 = $util.newBuffer([]); + + /** + * DocumentMessage directPath. + * @member {string} directPath + * @memberof proto.DocumentMessage + * @instance + */ + DocumentMessage.prototype.directPath = ""; + + /** + * DocumentMessage mediaKeyTimestamp. + * @member {number|Long} mediaKeyTimestamp + * @memberof proto.DocumentMessage + * @instance + */ + DocumentMessage.prototype.mediaKeyTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * DocumentMessage jpegThumbnail. + * @member {Uint8Array} jpegThumbnail + * @memberof proto.DocumentMessage + * @instance + */ + DocumentMessage.prototype.jpegThumbnail = $util.newBuffer([]); + + /** + * DocumentMessage contextInfo. + * @member {proto.IContextInfo|null|undefined} contextInfo + * @memberof proto.DocumentMessage + * @instance + */ + DocumentMessage.prototype.contextInfo = null; + + /** + * Creates a new DocumentMessage instance using the specified properties. + * @function create + * @memberof proto.DocumentMessage + * @static + * @param {proto.IDocumentMessage=} [properties] Properties to set + * @returns {proto.DocumentMessage} DocumentMessage instance + */ + DocumentMessage.create = function create(properties) { + return new DocumentMessage(properties); + }; + + /** + * Encodes the specified DocumentMessage message. Does not implicitly {@link proto.DocumentMessage.verify|verify} messages. + * @function encode + * @memberof proto.DocumentMessage + * @static + * @param {proto.IDocumentMessage} message DocumentMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.url != null && Object.hasOwnProperty.call(message, "url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.url); + if (message.mimetype != null && Object.hasOwnProperty.call(message, "mimetype")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.mimetype); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.title); + if (message.fileSha256 != null && Object.hasOwnProperty.call(message, "fileSha256")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.fileSha256); + if (message.fileLength != null && Object.hasOwnProperty.call(message, "fileLength")) + writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.fileLength); + if (message.pageCount != null && Object.hasOwnProperty.call(message, "pageCount")) + writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.pageCount); + if (message.mediaKey != null && Object.hasOwnProperty.call(message, "mediaKey")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.mediaKey); + if (message.fileName != null && Object.hasOwnProperty.call(message, "fileName")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.fileName); + if (message.fileEncSha256 != null && Object.hasOwnProperty.call(message, "fileEncSha256")) + writer.uint32(/* id 9, wireType 2 =*/74).bytes(message.fileEncSha256); + if (message.directPath != null && Object.hasOwnProperty.call(message, "directPath")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.directPath); + if (message.mediaKeyTimestamp != null && Object.hasOwnProperty.call(message, "mediaKeyTimestamp")) + writer.uint32(/* id 11, wireType 0 =*/88).int64(message.mediaKeyTimestamp); + if (message.jpegThumbnail != null && Object.hasOwnProperty.call(message, "jpegThumbnail")) + writer.uint32(/* id 16, wireType 2 =*/130).bytes(message.jpegThumbnail); + if (message.contextInfo != null && Object.hasOwnProperty.call(message, "contextInfo")) + $root.proto.ContextInfo.encode(message.contextInfo, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DocumentMessage message, length delimited. Does not implicitly {@link proto.DocumentMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.DocumentMessage + * @static + * @param {proto.IDocumentMessage} message DocumentMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DocumentMessage message from the specified reader or buffer. + * @function decode + * @memberof proto.DocumentMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.DocumentMessage} DocumentMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentMessage.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.DocumentMessage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.url = reader.string(); + break; + case 2: + message.mimetype = reader.string(); + break; + case 3: + message.title = reader.string(); + break; + case 4: + message.fileSha256 = reader.bytes(); + break; + case 5: + message.fileLength = reader.uint64(); + break; + case 6: + message.pageCount = reader.uint32(); + break; + case 7: + message.mediaKey = reader.bytes(); + break; + case 8: + message.fileName = reader.string(); + break; + case 9: + message.fileEncSha256 = reader.bytes(); + break; + case 10: + message.directPath = reader.string(); + break; + case 11: + message.mediaKeyTimestamp = reader.int64(); + break; + case 16: + message.jpegThumbnail = reader.bytes(); + break; + case 17: + message.contextInfo = $root.proto.ContextInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DocumentMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.DocumentMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.DocumentMessage} DocumentMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DocumentMessage message. + * @function verify + * @memberof proto.DocumentMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DocumentMessage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.url != null && message.hasOwnProperty("url")) + if (!$util.isString(message.url)) + return "url: string expected"; + if (message.mimetype != null && message.hasOwnProperty("mimetype")) + if (!$util.isString(message.mimetype)) + return "mimetype: string expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.fileSha256 != null && message.hasOwnProperty("fileSha256")) + if (!(message.fileSha256 && typeof message.fileSha256.length === "number" || $util.isString(message.fileSha256))) + return "fileSha256: buffer expected"; + if (message.fileLength != null && message.hasOwnProperty("fileLength")) + if (!$util.isInteger(message.fileLength) && !(message.fileLength && $util.isInteger(message.fileLength.low) && $util.isInteger(message.fileLength.high))) + return "fileLength: integer|Long expected"; + if (message.pageCount != null && message.hasOwnProperty("pageCount")) + if (!$util.isInteger(message.pageCount)) + return "pageCount: integer expected"; + if (message.mediaKey != null && message.hasOwnProperty("mediaKey")) + if (!(message.mediaKey && typeof message.mediaKey.length === "number" || $util.isString(message.mediaKey))) + return "mediaKey: buffer expected"; + if (message.fileName != null && message.hasOwnProperty("fileName")) + if (!$util.isString(message.fileName)) + return "fileName: string expected"; + if (message.fileEncSha256 != null && message.hasOwnProperty("fileEncSha256")) + if (!(message.fileEncSha256 && typeof message.fileEncSha256.length === "number" || $util.isString(message.fileEncSha256))) + return "fileEncSha256: buffer expected"; + if (message.directPath != null && message.hasOwnProperty("directPath")) + if (!$util.isString(message.directPath)) + return "directPath: string expected"; + if (message.mediaKeyTimestamp != null && message.hasOwnProperty("mediaKeyTimestamp")) + if (!$util.isInteger(message.mediaKeyTimestamp) && !(message.mediaKeyTimestamp && $util.isInteger(message.mediaKeyTimestamp.low) && $util.isInteger(message.mediaKeyTimestamp.high))) + return "mediaKeyTimestamp: integer|Long expected"; + if (message.jpegThumbnail != null && message.hasOwnProperty("jpegThumbnail")) + if (!(message.jpegThumbnail && typeof message.jpegThumbnail.length === "number" || $util.isString(message.jpegThumbnail))) + return "jpegThumbnail: buffer expected"; + if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) { + var error = $root.proto.ContextInfo.verify(message.contextInfo); + if (error) + return "contextInfo." + error; + } + return null; + }; + + /** + * Creates a DocumentMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.DocumentMessage + * @static + * @param {Object.} object Plain object + * @returns {proto.DocumentMessage} DocumentMessage + */ + DocumentMessage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.DocumentMessage) + return object; + var message = new $root.proto.DocumentMessage(); + if (object.url != null) + message.url = String(object.url); + if (object.mimetype != null) + message.mimetype = String(object.mimetype); + if (object.title != null) + message.title = String(object.title); + if (object.fileSha256 != null) + if (typeof object.fileSha256 === "string") + $util.base64.decode(object.fileSha256, message.fileSha256 = $util.newBuffer($util.base64.length(object.fileSha256)), 0); + else if (object.fileSha256.length) + message.fileSha256 = object.fileSha256; + if (object.fileLength != null) + if ($util.Long) + (message.fileLength = $util.Long.fromValue(object.fileLength)).unsigned = true; + else if (typeof object.fileLength === "string") + message.fileLength = parseInt(object.fileLength, 10); + else if (typeof object.fileLength === "number") + message.fileLength = object.fileLength; + else if (typeof object.fileLength === "object") + message.fileLength = new $util.LongBits(object.fileLength.low >>> 0, object.fileLength.high >>> 0).toNumber(true); + if (object.pageCount != null) + message.pageCount = object.pageCount >>> 0; + if (object.mediaKey != null) + if (typeof object.mediaKey === "string") + $util.base64.decode(object.mediaKey, message.mediaKey = $util.newBuffer($util.base64.length(object.mediaKey)), 0); + else if (object.mediaKey.length) + message.mediaKey = object.mediaKey; + if (object.fileName != null) + message.fileName = String(object.fileName); + if (object.fileEncSha256 != null) + if (typeof object.fileEncSha256 === "string") + $util.base64.decode(object.fileEncSha256, message.fileEncSha256 = $util.newBuffer($util.base64.length(object.fileEncSha256)), 0); + else if (object.fileEncSha256.length) + message.fileEncSha256 = object.fileEncSha256; + if (object.directPath != null) + message.directPath = String(object.directPath); + if (object.mediaKeyTimestamp != null) + if ($util.Long) + (message.mediaKeyTimestamp = $util.Long.fromValue(object.mediaKeyTimestamp)).unsigned = false; + else if (typeof object.mediaKeyTimestamp === "string") + message.mediaKeyTimestamp = parseInt(object.mediaKeyTimestamp, 10); + else if (typeof object.mediaKeyTimestamp === "number") + message.mediaKeyTimestamp = object.mediaKeyTimestamp; + else if (typeof object.mediaKeyTimestamp === "object") + message.mediaKeyTimestamp = new $util.LongBits(object.mediaKeyTimestamp.low >>> 0, object.mediaKeyTimestamp.high >>> 0).toNumber(); + if (object.jpegThumbnail != null) + if (typeof object.jpegThumbnail === "string") + $util.base64.decode(object.jpegThumbnail, message.jpegThumbnail = $util.newBuffer($util.base64.length(object.jpegThumbnail)), 0); + else if (object.jpegThumbnail.length) + message.jpegThumbnail = object.jpegThumbnail; + if (object.contextInfo != null) { + if (typeof object.contextInfo !== "object") + throw TypeError(".proto.DocumentMessage.contextInfo: object expected"); + message.contextInfo = $root.proto.ContextInfo.fromObject(object.contextInfo); + } + return message; + }; + + /** + * Creates a plain object from a DocumentMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.DocumentMessage + * @static + * @param {proto.DocumentMessage} message DocumentMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DocumentMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.url = ""; + object.mimetype = ""; + object.title = ""; + if (options.bytes === String) + object.fileSha256 = ""; + else { + object.fileSha256 = []; + if (options.bytes !== Array) + object.fileSha256 = $util.newBuffer(object.fileSha256); + } + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.fileLength = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.fileLength = options.longs === String ? "0" : 0; + object.pageCount = 0; + if (options.bytes === String) + object.mediaKey = ""; + else { + object.mediaKey = []; + if (options.bytes !== Array) + object.mediaKey = $util.newBuffer(object.mediaKey); + } + object.fileName = ""; + if (options.bytes === String) + object.fileEncSha256 = ""; + else { + object.fileEncSha256 = []; + if (options.bytes !== Array) + object.fileEncSha256 = $util.newBuffer(object.fileEncSha256); + } + object.directPath = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.mediaKeyTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.mediaKeyTimestamp = options.longs === String ? "0" : 0; + if (options.bytes === String) + object.jpegThumbnail = ""; + else { + object.jpegThumbnail = []; + if (options.bytes !== Array) + object.jpegThumbnail = $util.newBuffer(object.jpegThumbnail); + } + object.contextInfo = null; + } + if (message.url != null && message.hasOwnProperty("url")) + object.url = message.url; + if (message.mimetype != null && message.hasOwnProperty("mimetype")) + object.mimetype = message.mimetype; + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.fileSha256 != null && message.hasOwnProperty("fileSha256")) + object.fileSha256 = options.bytes === String ? $util.base64.encode(message.fileSha256, 0, message.fileSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.fileSha256) : message.fileSha256; + if (message.fileLength != null && message.hasOwnProperty("fileLength")) + if (typeof message.fileLength === "number") + object.fileLength = options.longs === String ? String(message.fileLength) : message.fileLength; + else + object.fileLength = options.longs === String ? $util.Long.prototype.toString.call(message.fileLength) : options.longs === Number ? new $util.LongBits(message.fileLength.low >>> 0, message.fileLength.high >>> 0).toNumber(true) : message.fileLength; + if (message.pageCount != null && message.hasOwnProperty("pageCount")) + object.pageCount = message.pageCount; + if (message.mediaKey != null && message.hasOwnProperty("mediaKey")) + object.mediaKey = options.bytes === String ? $util.base64.encode(message.mediaKey, 0, message.mediaKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.mediaKey) : message.mediaKey; + if (message.fileName != null && message.hasOwnProperty("fileName")) + object.fileName = message.fileName; + if (message.fileEncSha256 != null && message.hasOwnProperty("fileEncSha256")) + object.fileEncSha256 = options.bytes === String ? $util.base64.encode(message.fileEncSha256, 0, message.fileEncSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.fileEncSha256) : message.fileEncSha256; + if (message.directPath != null && message.hasOwnProperty("directPath")) + object.directPath = message.directPath; + if (message.mediaKeyTimestamp != null && message.hasOwnProperty("mediaKeyTimestamp")) + if (typeof message.mediaKeyTimestamp === "number") + object.mediaKeyTimestamp = options.longs === String ? String(message.mediaKeyTimestamp) : message.mediaKeyTimestamp; + else + object.mediaKeyTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.mediaKeyTimestamp) : options.longs === Number ? new $util.LongBits(message.mediaKeyTimestamp.low >>> 0, message.mediaKeyTimestamp.high >>> 0).toNumber() : message.mediaKeyTimestamp; + if (message.jpegThumbnail != null && message.hasOwnProperty("jpegThumbnail")) + object.jpegThumbnail = options.bytes === String ? $util.base64.encode(message.jpegThumbnail, 0, message.jpegThumbnail.length) : options.bytes === Array ? Array.prototype.slice.call(message.jpegThumbnail) : message.jpegThumbnail; + if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) + object.contextInfo = $root.proto.ContextInfo.toObject(message.contextInfo, options); + return object; + }; + + /** + * Converts this DocumentMessage to JSON. + * @function toJSON + * @memberof proto.DocumentMessage + * @instance + * @returns {Object.} JSON object + */ + DocumentMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DocumentMessage; + })(); + + proto.AudioMessage = (function() { + + /** + * Properties of an AudioMessage. + * @memberof proto + * @interface IAudioMessage + * @property {string|null} [url] AudioMessage url + * @property {string|null} [mimetype] AudioMessage mimetype + * @property {Uint8Array|null} [fileSha256] AudioMessage fileSha256 + * @property {number|Long|null} [fileLength] AudioMessage fileLength + * @property {number|null} [seconds] AudioMessage seconds + * @property {boolean|null} [ptt] AudioMessage ptt + * @property {Uint8Array|null} [mediaKey] AudioMessage mediaKey + * @property {Uint8Array|null} [fileEncSha256] AudioMessage fileEncSha256 + * @property {string|null} [directPath] AudioMessage directPath + * @property {number|Long|null} [mediaKeyTimestamp] AudioMessage mediaKeyTimestamp + * @property {proto.IContextInfo|null} [contextInfo] AudioMessage contextInfo + * @property {Uint8Array|null} [streamingSidecar] AudioMessage streamingSidecar + */ + + /** + * Constructs a new AudioMessage. + * @memberof proto + * @classdesc Represents an AudioMessage. + * @implements IAudioMessage + * @constructor + * @param {proto.IAudioMessage=} [properties] Properties to set + */ + function AudioMessage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AudioMessage url. + * @member {string} url + * @memberof proto.AudioMessage + * @instance + */ + AudioMessage.prototype.url = ""; + + /** + * AudioMessage mimetype. + * @member {string} mimetype + * @memberof proto.AudioMessage + * @instance + */ + AudioMessage.prototype.mimetype = ""; + + /** + * AudioMessage fileSha256. + * @member {Uint8Array} fileSha256 + * @memberof proto.AudioMessage + * @instance + */ + AudioMessage.prototype.fileSha256 = $util.newBuffer([]); + + /** + * AudioMessage fileLength. + * @member {number|Long} fileLength + * @memberof proto.AudioMessage + * @instance + */ + AudioMessage.prototype.fileLength = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * AudioMessage seconds. + * @member {number} seconds + * @memberof proto.AudioMessage + * @instance + */ + AudioMessage.prototype.seconds = 0; + + /** + * AudioMessage ptt. + * @member {boolean} ptt + * @memberof proto.AudioMessage + * @instance + */ + AudioMessage.prototype.ptt = false; + + /** + * AudioMessage mediaKey. + * @member {Uint8Array} mediaKey + * @memberof proto.AudioMessage + * @instance + */ + AudioMessage.prototype.mediaKey = $util.newBuffer([]); + + /** + * AudioMessage fileEncSha256. + * @member {Uint8Array} fileEncSha256 + * @memberof proto.AudioMessage + * @instance + */ + AudioMessage.prototype.fileEncSha256 = $util.newBuffer([]); + + /** + * AudioMessage directPath. + * @member {string} directPath + * @memberof proto.AudioMessage + * @instance + */ + AudioMessage.prototype.directPath = ""; + + /** + * AudioMessage mediaKeyTimestamp. + * @member {number|Long} mediaKeyTimestamp + * @memberof proto.AudioMessage + * @instance + */ + AudioMessage.prototype.mediaKeyTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * AudioMessage contextInfo. + * @member {proto.IContextInfo|null|undefined} contextInfo + * @memberof proto.AudioMessage + * @instance + */ + AudioMessage.prototype.contextInfo = null; + + /** + * AudioMessage streamingSidecar. + * @member {Uint8Array} streamingSidecar + * @memberof proto.AudioMessage + * @instance + */ + AudioMessage.prototype.streamingSidecar = $util.newBuffer([]); + + /** + * Creates a new AudioMessage instance using the specified properties. + * @function create + * @memberof proto.AudioMessage + * @static + * @param {proto.IAudioMessage=} [properties] Properties to set + * @returns {proto.AudioMessage} AudioMessage instance + */ + AudioMessage.create = function create(properties) { + return new AudioMessage(properties); + }; + + /** + * Encodes the specified AudioMessage message. Does not implicitly {@link proto.AudioMessage.verify|verify} messages. + * @function encode + * @memberof proto.AudioMessage + * @static + * @param {proto.IAudioMessage} message AudioMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AudioMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.url != null && Object.hasOwnProperty.call(message, "url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.url); + if (message.mimetype != null && Object.hasOwnProperty.call(message, "mimetype")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.mimetype); + if (message.fileSha256 != null && Object.hasOwnProperty.call(message, "fileSha256")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.fileSha256); + if (message.fileLength != null && Object.hasOwnProperty.call(message, "fileLength")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.fileLength); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.seconds); + if (message.ptt != null && Object.hasOwnProperty.call(message, "ptt")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.ptt); + if (message.mediaKey != null && Object.hasOwnProperty.call(message, "mediaKey")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.mediaKey); + if (message.fileEncSha256 != null && Object.hasOwnProperty.call(message, "fileEncSha256")) + writer.uint32(/* id 8, wireType 2 =*/66).bytes(message.fileEncSha256); + if (message.directPath != null && Object.hasOwnProperty.call(message, "directPath")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.directPath); + if (message.mediaKeyTimestamp != null && Object.hasOwnProperty.call(message, "mediaKeyTimestamp")) + writer.uint32(/* id 10, wireType 0 =*/80).int64(message.mediaKeyTimestamp); + if (message.contextInfo != null && Object.hasOwnProperty.call(message, "contextInfo")) + $root.proto.ContextInfo.encode(message.contextInfo, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.streamingSidecar != null && Object.hasOwnProperty.call(message, "streamingSidecar")) + writer.uint32(/* id 18, wireType 2 =*/146).bytes(message.streamingSidecar); + return writer; + }; + + /** + * Encodes the specified AudioMessage message, length delimited. Does not implicitly {@link proto.AudioMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.AudioMessage + * @static + * @param {proto.IAudioMessage} message AudioMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AudioMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AudioMessage message from the specified reader or buffer. + * @function decode + * @memberof proto.AudioMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.AudioMessage} AudioMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AudioMessage.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.AudioMessage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.url = reader.string(); + break; + case 2: + message.mimetype = reader.string(); + break; + case 3: + message.fileSha256 = reader.bytes(); + break; + case 4: + message.fileLength = reader.uint64(); + break; + case 5: + message.seconds = reader.uint32(); + break; + case 6: + message.ptt = reader.bool(); + break; + case 7: + message.mediaKey = reader.bytes(); + break; + case 8: + message.fileEncSha256 = reader.bytes(); + break; + case 9: + message.directPath = reader.string(); + break; + case 10: + message.mediaKeyTimestamp = reader.int64(); + break; + case 17: + message.contextInfo = $root.proto.ContextInfo.decode(reader, reader.uint32()); + break; + case 18: + message.streamingSidecar = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AudioMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.AudioMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.AudioMessage} AudioMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AudioMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AudioMessage message. + * @function verify + * @memberof proto.AudioMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AudioMessage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.url != null && message.hasOwnProperty("url")) + if (!$util.isString(message.url)) + return "url: string expected"; + if (message.mimetype != null && message.hasOwnProperty("mimetype")) + if (!$util.isString(message.mimetype)) + return "mimetype: string expected"; + if (message.fileSha256 != null && message.hasOwnProperty("fileSha256")) + if (!(message.fileSha256 && typeof message.fileSha256.length === "number" || $util.isString(message.fileSha256))) + return "fileSha256: buffer expected"; + if (message.fileLength != null && message.hasOwnProperty("fileLength")) + if (!$util.isInteger(message.fileLength) && !(message.fileLength && $util.isInteger(message.fileLength.low) && $util.isInteger(message.fileLength.high))) + return "fileLength: integer|Long expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds)) + return "seconds: integer expected"; + if (message.ptt != null && message.hasOwnProperty("ptt")) + if (typeof message.ptt !== "boolean") + return "ptt: boolean expected"; + if (message.mediaKey != null && message.hasOwnProperty("mediaKey")) + if (!(message.mediaKey && typeof message.mediaKey.length === "number" || $util.isString(message.mediaKey))) + return "mediaKey: buffer expected"; + if (message.fileEncSha256 != null && message.hasOwnProperty("fileEncSha256")) + if (!(message.fileEncSha256 && typeof message.fileEncSha256.length === "number" || $util.isString(message.fileEncSha256))) + return "fileEncSha256: buffer expected"; + if (message.directPath != null && message.hasOwnProperty("directPath")) + if (!$util.isString(message.directPath)) + return "directPath: string expected"; + if (message.mediaKeyTimestamp != null && message.hasOwnProperty("mediaKeyTimestamp")) + if (!$util.isInteger(message.mediaKeyTimestamp) && !(message.mediaKeyTimestamp && $util.isInteger(message.mediaKeyTimestamp.low) && $util.isInteger(message.mediaKeyTimestamp.high))) + return "mediaKeyTimestamp: integer|Long expected"; + if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) { + var error = $root.proto.ContextInfo.verify(message.contextInfo); + if (error) + return "contextInfo." + error; + } + if (message.streamingSidecar != null && message.hasOwnProperty("streamingSidecar")) + if (!(message.streamingSidecar && typeof message.streamingSidecar.length === "number" || $util.isString(message.streamingSidecar))) + return "streamingSidecar: buffer expected"; + return null; + }; + + /** + * Creates an AudioMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.AudioMessage + * @static + * @param {Object.} object Plain object + * @returns {proto.AudioMessage} AudioMessage + */ + AudioMessage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.AudioMessage) + return object; + var message = new $root.proto.AudioMessage(); + if (object.url != null) + message.url = String(object.url); + if (object.mimetype != null) + message.mimetype = String(object.mimetype); + if (object.fileSha256 != null) + if (typeof object.fileSha256 === "string") + $util.base64.decode(object.fileSha256, message.fileSha256 = $util.newBuffer($util.base64.length(object.fileSha256)), 0); + else if (object.fileSha256.length) + message.fileSha256 = object.fileSha256; + if (object.fileLength != null) + if ($util.Long) + (message.fileLength = $util.Long.fromValue(object.fileLength)).unsigned = true; + else if (typeof object.fileLength === "string") + message.fileLength = parseInt(object.fileLength, 10); + else if (typeof object.fileLength === "number") + message.fileLength = object.fileLength; + else if (typeof object.fileLength === "object") + message.fileLength = new $util.LongBits(object.fileLength.low >>> 0, object.fileLength.high >>> 0).toNumber(true); + if (object.seconds != null) + message.seconds = object.seconds >>> 0; + if (object.ptt != null) + message.ptt = Boolean(object.ptt); + if (object.mediaKey != null) + if (typeof object.mediaKey === "string") + $util.base64.decode(object.mediaKey, message.mediaKey = $util.newBuffer($util.base64.length(object.mediaKey)), 0); + else if (object.mediaKey.length) + message.mediaKey = object.mediaKey; + if (object.fileEncSha256 != null) + if (typeof object.fileEncSha256 === "string") + $util.base64.decode(object.fileEncSha256, message.fileEncSha256 = $util.newBuffer($util.base64.length(object.fileEncSha256)), 0); + else if (object.fileEncSha256.length) + message.fileEncSha256 = object.fileEncSha256; + if (object.directPath != null) + message.directPath = String(object.directPath); + if (object.mediaKeyTimestamp != null) + if ($util.Long) + (message.mediaKeyTimestamp = $util.Long.fromValue(object.mediaKeyTimestamp)).unsigned = false; + else if (typeof object.mediaKeyTimestamp === "string") + message.mediaKeyTimestamp = parseInt(object.mediaKeyTimestamp, 10); + else if (typeof object.mediaKeyTimestamp === "number") + message.mediaKeyTimestamp = object.mediaKeyTimestamp; + else if (typeof object.mediaKeyTimestamp === "object") + message.mediaKeyTimestamp = new $util.LongBits(object.mediaKeyTimestamp.low >>> 0, object.mediaKeyTimestamp.high >>> 0).toNumber(); + if (object.contextInfo != null) { + if (typeof object.contextInfo !== "object") + throw TypeError(".proto.AudioMessage.contextInfo: object expected"); + message.contextInfo = $root.proto.ContextInfo.fromObject(object.contextInfo); + } + if (object.streamingSidecar != null) + if (typeof object.streamingSidecar === "string") + $util.base64.decode(object.streamingSidecar, message.streamingSidecar = $util.newBuffer($util.base64.length(object.streamingSidecar)), 0); + else if (object.streamingSidecar.length) + message.streamingSidecar = object.streamingSidecar; + return message; + }; + + /** + * Creates a plain object from an AudioMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.AudioMessage + * @static + * @param {proto.AudioMessage} message AudioMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AudioMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.url = ""; + object.mimetype = ""; + if (options.bytes === String) + object.fileSha256 = ""; + else { + object.fileSha256 = []; + if (options.bytes !== Array) + object.fileSha256 = $util.newBuffer(object.fileSha256); + } + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.fileLength = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.fileLength = options.longs === String ? "0" : 0; + object.seconds = 0; + object.ptt = false; + if (options.bytes === String) + object.mediaKey = ""; + else { + object.mediaKey = []; + if (options.bytes !== Array) + object.mediaKey = $util.newBuffer(object.mediaKey); + } + if (options.bytes === String) + object.fileEncSha256 = ""; + else { + object.fileEncSha256 = []; + if (options.bytes !== Array) + object.fileEncSha256 = $util.newBuffer(object.fileEncSha256); + } + object.directPath = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.mediaKeyTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.mediaKeyTimestamp = options.longs === String ? "0" : 0; + object.contextInfo = null; + if (options.bytes === String) + object.streamingSidecar = ""; + else { + object.streamingSidecar = []; + if (options.bytes !== Array) + object.streamingSidecar = $util.newBuffer(object.streamingSidecar); + } + } + if (message.url != null && message.hasOwnProperty("url")) + object.url = message.url; + if (message.mimetype != null && message.hasOwnProperty("mimetype")) + object.mimetype = message.mimetype; + if (message.fileSha256 != null && message.hasOwnProperty("fileSha256")) + object.fileSha256 = options.bytes === String ? $util.base64.encode(message.fileSha256, 0, message.fileSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.fileSha256) : message.fileSha256; + if (message.fileLength != null && message.hasOwnProperty("fileLength")) + if (typeof message.fileLength === "number") + object.fileLength = options.longs === String ? String(message.fileLength) : message.fileLength; + else + object.fileLength = options.longs === String ? $util.Long.prototype.toString.call(message.fileLength) : options.longs === Number ? new $util.LongBits(message.fileLength.low >>> 0, message.fileLength.high >>> 0).toNumber(true) : message.fileLength; + if (message.seconds != null && message.hasOwnProperty("seconds")) + object.seconds = message.seconds; + if (message.ptt != null && message.hasOwnProperty("ptt")) + object.ptt = message.ptt; + if (message.mediaKey != null && message.hasOwnProperty("mediaKey")) + object.mediaKey = options.bytes === String ? $util.base64.encode(message.mediaKey, 0, message.mediaKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.mediaKey) : message.mediaKey; + if (message.fileEncSha256 != null && message.hasOwnProperty("fileEncSha256")) + object.fileEncSha256 = options.bytes === String ? $util.base64.encode(message.fileEncSha256, 0, message.fileEncSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.fileEncSha256) : message.fileEncSha256; + if (message.directPath != null && message.hasOwnProperty("directPath")) + object.directPath = message.directPath; + if (message.mediaKeyTimestamp != null && message.hasOwnProperty("mediaKeyTimestamp")) + if (typeof message.mediaKeyTimestamp === "number") + object.mediaKeyTimestamp = options.longs === String ? String(message.mediaKeyTimestamp) : message.mediaKeyTimestamp; + else + object.mediaKeyTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.mediaKeyTimestamp) : options.longs === Number ? new $util.LongBits(message.mediaKeyTimestamp.low >>> 0, message.mediaKeyTimestamp.high >>> 0).toNumber() : message.mediaKeyTimestamp; + if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) + object.contextInfo = $root.proto.ContextInfo.toObject(message.contextInfo, options); + if (message.streamingSidecar != null && message.hasOwnProperty("streamingSidecar")) + object.streamingSidecar = options.bytes === String ? $util.base64.encode(message.streamingSidecar, 0, message.streamingSidecar.length) : options.bytes === Array ? Array.prototype.slice.call(message.streamingSidecar) : message.streamingSidecar; + return object; + }; + + /** + * Converts this AudioMessage to JSON. + * @function toJSON + * @memberof proto.AudioMessage + * @instance + * @returns {Object.} JSON object + */ + AudioMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AudioMessage; + })(); + + proto.VideoMessage = (function() { + + /** + * Properties of a VideoMessage. + * @memberof proto + * @interface IVideoMessage + * @property {string|null} [url] VideoMessage url + * @property {string|null} [mimetype] VideoMessage mimetype + * @property {Uint8Array|null} [fileSha256] VideoMessage fileSha256 + * @property {number|Long|null} [fileLength] VideoMessage fileLength + * @property {number|null} [seconds] VideoMessage seconds + * @property {Uint8Array|null} [mediaKey] VideoMessage mediaKey + * @property {string|null} [caption] VideoMessage caption + * @property {boolean|null} [gifPlayback] VideoMessage gifPlayback + * @property {number|null} [height] VideoMessage height + * @property {number|null} [width] VideoMessage width + * @property {Uint8Array|null} [fileEncSha256] VideoMessage fileEncSha256 + * @property {Array.|null} [interactiveAnnotations] VideoMessage interactiveAnnotations + * @property {string|null} [directPath] VideoMessage directPath + * @property {number|Long|null} [mediaKeyTimestamp] VideoMessage mediaKeyTimestamp + * @property {Uint8Array|null} [jpegThumbnail] VideoMessage jpegThumbnail + * @property {proto.IContextInfo|null} [contextInfo] VideoMessage contextInfo + * @property {Uint8Array|null} [streamingSidecar] VideoMessage streamingSidecar + * @property {proto.VideoMessage.VIDEO_MESSAGE_ATTRIBUTION|null} [gifAttribution] VideoMessage gifAttribution + */ + + /** + * Constructs a new VideoMessage. + * @memberof proto + * @classdesc Represents a VideoMessage. + * @implements IVideoMessage + * @constructor + * @param {proto.IVideoMessage=} [properties] Properties to set + */ + function VideoMessage(properties) { + this.interactiveAnnotations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VideoMessage url. + * @member {string} url + * @memberof proto.VideoMessage + * @instance + */ + VideoMessage.prototype.url = ""; + + /** + * VideoMessage mimetype. + * @member {string} mimetype + * @memberof proto.VideoMessage + * @instance + */ + VideoMessage.prototype.mimetype = ""; + + /** + * VideoMessage fileSha256. + * @member {Uint8Array} fileSha256 + * @memberof proto.VideoMessage + * @instance + */ + VideoMessage.prototype.fileSha256 = $util.newBuffer([]); + + /** + * VideoMessage fileLength. + * @member {number|Long} fileLength + * @memberof proto.VideoMessage + * @instance + */ + VideoMessage.prototype.fileLength = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * VideoMessage seconds. + * @member {number} seconds + * @memberof proto.VideoMessage + * @instance + */ + VideoMessage.prototype.seconds = 0; + + /** + * VideoMessage mediaKey. + * @member {Uint8Array} mediaKey + * @memberof proto.VideoMessage + * @instance + */ + VideoMessage.prototype.mediaKey = $util.newBuffer([]); + + /** + * VideoMessage caption. + * @member {string} caption + * @memberof proto.VideoMessage + * @instance + */ + VideoMessage.prototype.caption = ""; + + /** + * VideoMessage gifPlayback. + * @member {boolean} gifPlayback + * @memberof proto.VideoMessage + * @instance + */ + VideoMessage.prototype.gifPlayback = false; + + /** + * VideoMessage height. + * @member {number} height + * @memberof proto.VideoMessage + * @instance + */ + VideoMessage.prototype.height = 0; + + /** + * VideoMessage width. + * @member {number} width + * @memberof proto.VideoMessage + * @instance + */ + VideoMessage.prototype.width = 0; + + /** + * VideoMessage fileEncSha256. + * @member {Uint8Array} fileEncSha256 + * @memberof proto.VideoMessage + * @instance + */ + VideoMessage.prototype.fileEncSha256 = $util.newBuffer([]); + + /** + * VideoMessage interactiveAnnotations. + * @member {Array.} interactiveAnnotations + * @memberof proto.VideoMessage + * @instance + */ + VideoMessage.prototype.interactiveAnnotations = $util.emptyArray; + + /** + * VideoMessage directPath. + * @member {string} directPath + * @memberof proto.VideoMessage + * @instance + */ + VideoMessage.prototype.directPath = ""; + + /** + * VideoMessage mediaKeyTimestamp. + * @member {number|Long} mediaKeyTimestamp + * @memberof proto.VideoMessage + * @instance + */ + VideoMessage.prototype.mediaKeyTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * VideoMessage jpegThumbnail. + * @member {Uint8Array} jpegThumbnail + * @memberof proto.VideoMessage + * @instance + */ + VideoMessage.prototype.jpegThumbnail = $util.newBuffer([]); + + /** + * VideoMessage contextInfo. + * @member {proto.IContextInfo|null|undefined} contextInfo + * @memberof proto.VideoMessage + * @instance + */ + VideoMessage.prototype.contextInfo = null; + + /** + * VideoMessage streamingSidecar. + * @member {Uint8Array} streamingSidecar + * @memberof proto.VideoMessage + * @instance + */ + VideoMessage.prototype.streamingSidecar = $util.newBuffer([]); + + /** + * VideoMessage gifAttribution. + * @member {proto.VideoMessage.VIDEO_MESSAGE_ATTRIBUTION} gifAttribution + * @memberof proto.VideoMessage + * @instance + */ + VideoMessage.prototype.gifAttribution = 0; + + /** + * Creates a new VideoMessage instance using the specified properties. + * @function create + * @memberof proto.VideoMessage + * @static + * @param {proto.IVideoMessage=} [properties] Properties to set + * @returns {proto.VideoMessage} VideoMessage instance + */ + VideoMessage.create = function create(properties) { + return new VideoMessage(properties); + }; + + /** + * Encodes the specified VideoMessage message. Does not implicitly {@link proto.VideoMessage.verify|verify} messages. + * @function encode + * @memberof proto.VideoMessage + * @static + * @param {proto.IVideoMessage} message VideoMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.url != null && Object.hasOwnProperty.call(message, "url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.url); + if (message.mimetype != null && Object.hasOwnProperty.call(message, "mimetype")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.mimetype); + if (message.fileSha256 != null && Object.hasOwnProperty.call(message, "fileSha256")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.fileSha256); + if (message.fileLength != null && Object.hasOwnProperty.call(message, "fileLength")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.fileLength); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.seconds); + if (message.mediaKey != null && Object.hasOwnProperty.call(message, "mediaKey")) + writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.mediaKey); + if (message.caption != null && Object.hasOwnProperty.call(message, "caption")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.caption); + if (message.gifPlayback != null && Object.hasOwnProperty.call(message, "gifPlayback")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.gifPlayback); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 9, wireType 0 =*/72).uint32(message.height); + if (message.width != null && Object.hasOwnProperty.call(message, "width")) + writer.uint32(/* id 10, wireType 0 =*/80).uint32(message.width); + if (message.fileEncSha256 != null && Object.hasOwnProperty.call(message, "fileEncSha256")) + writer.uint32(/* id 11, wireType 2 =*/90).bytes(message.fileEncSha256); + if (message.interactiveAnnotations != null && message.interactiveAnnotations.length) + for (var i = 0; i < message.interactiveAnnotations.length; ++i) + $root.proto.InteractiveAnnotation.encode(message.interactiveAnnotations[i], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.directPath != null && Object.hasOwnProperty.call(message, "directPath")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.directPath); + if (message.mediaKeyTimestamp != null && Object.hasOwnProperty.call(message, "mediaKeyTimestamp")) + writer.uint32(/* id 14, wireType 0 =*/112).int64(message.mediaKeyTimestamp); + if (message.jpegThumbnail != null && Object.hasOwnProperty.call(message, "jpegThumbnail")) + writer.uint32(/* id 16, wireType 2 =*/130).bytes(message.jpegThumbnail); + if (message.contextInfo != null && Object.hasOwnProperty.call(message, "contextInfo")) + $root.proto.ContextInfo.encode(message.contextInfo, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.streamingSidecar != null && Object.hasOwnProperty.call(message, "streamingSidecar")) + writer.uint32(/* id 18, wireType 2 =*/146).bytes(message.streamingSidecar); + if (message.gifAttribution != null && Object.hasOwnProperty.call(message, "gifAttribution")) + writer.uint32(/* id 19, wireType 0 =*/152).int32(message.gifAttribution); + return writer; + }; + + /** + * Encodes the specified VideoMessage message, length delimited. Does not implicitly {@link proto.VideoMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.VideoMessage + * @static + * @param {proto.IVideoMessage} message VideoMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VideoMessage message from the specified reader or buffer. + * @function decode + * @memberof proto.VideoMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.VideoMessage} VideoMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoMessage.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.VideoMessage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.url = reader.string(); + break; + case 2: + message.mimetype = reader.string(); + break; + case 3: + message.fileSha256 = reader.bytes(); + break; + case 4: + message.fileLength = reader.uint64(); + break; + case 5: + message.seconds = reader.uint32(); + break; + case 6: + message.mediaKey = reader.bytes(); + break; + case 7: + message.caption = reader.string(); + break; + case 8: + message.gifPlayback = reader.bool(); + break; + case 9: + message.height = reader.uint32(); + break; + case 10: + message.width = reader.uint32(); + break; + case 11: + message.fileEncSha256 = reader.bytes(); + break; + case 12: + if (!(message.interactiveAnnotations && message.interactiveAnnotations.length)) + message.interactiveAnnotations = []; + message.interactiveAnnotations.push($root.proto.InteractiveAnnotation.decode(reader, reader.uint32())); + break; + case 13: + message.directPath = reader.string(); + break; + case 14: + message.mediaKeyTimestamp = reader.int64(); + break; + case 16: + message.jpegThumbnail = reader.bytes(); + break; + case 17: + message.contextInfo = $root.proto.ContextInfo.decode(reader, reader.uint32()); + break; + case 18: + message.streamingSidecar = reader.bytes(); + break; + case 19: + message.gifAttribution = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VideoMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.VideoMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.VideoMessage} VideoMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VideoMessage message. + * @function verify + * @memberof proto.VideoMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VideoMessage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.url != null && message.hasOwnProperty("url")) + if (!$util.isString(message.url)) + return "url: string expected"; + if (message.mimetype != null && message.hasOwnProperty("mimetype")) + if (!$util.isString(message.mimetype)) + return "mimetype: string expected"; + if (message.fileSha256 != null && message.hasOwnProperty("fileSha256")) + if (!(message.fileSha256 && typeof message.fileSha256.length === "number" || $util.isString(message.fileSha256))) + return "fileSha256: buffer expected"; + if (message.fileLength != null && message.hasOwnProperty("fileLength")) + if (!$util.isInteger(message.fileLength) && !(message.fileLength && $util.isInteger(message.fileLength.low) && $util.isInteger(message.fileLength.high))) + return "fileLength: integer|Long expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds)) + return "seconds: integer expected"; + if (message.mediaKey != null && message.hasOwnProperty("mediaKey")) + if (!(message.mediaKey && typeof message.mediaKey.length === "number" || $util.isString(message.mediaKey))) + return "mediaKey: buffer expected"; + if (message.caption != null && message.hasOwnProperty("caption")) + if (!$util.isString(message.caption)) + return "caption: string expected"; + if (message.gifPlayback != null && message.hasOwnProperty("gifPlayback")) + if (typeof message.gifPlayback !== "boolean") + return "gifPlayback: boolean expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height)) + return "height: integer expected"; + if (message.width != null && message.hasOwnProperty("width")) + if (!$util.isInteger(message.width)) + return "width: integer expected"; + if (message.fileEncSha256 != null && message.hasOwnProperty("fileEncSha256")) + if (!(message.fileEncSha256 && typeof message.fileEncSha256.length === "number" || $util.isString(message.fileEncSha256))) + return "fileEncSha256: buffer expected"; + if (message.interactiveAnnotations != null && message.hasOwnProperty("interactiveAnnotations")) { + if (!Array.isArray(message.interactiveAnnotations)) + return "interactiveAnnotations: array expected"; + for (var i = 0; i < message.interactiveAnnotations.length; ++i) { + var error = $root.proto.InteractiveAnnotation.verify(message.interactiveAnnotations[i]); + if (error) + return "interactiveAnnotations." + error; + } + } + if (message.directPath != null && message.hasOwnProperty("directPath")) + if (!$util.isString(message.directPath)) + return "directPath: string expected"; + if (message.mediaKeyTimestamp != null && message.hasOwnProperty("mediaKeyTimestamp")) + if (!$util.isInteger(message.mediaKeyTimestamp) && !(message.mediaKeyTimestamp && $util.isInteger(message.mediaKeyTimestamp.low) && $util.isInteger(message.mediaKeyTimestamp.high))) + return "mediaKeyTimestamp: integer|Long expected"; + if (message.jpegThumbnail != null && message.hasOwnProperty("jpegThumbnail")) + if (!(message.jpegThumbnail && typeof message.jpegThumbnail.length === "number" || $util.isString(message.jpegThumbnail))) + return "jpegThumbnail: buffer expected"; + if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) { + var error = $root.proto.ContextInfo.verify(message.contextInfo); + if (error) + return "contextInfo." + error; + } + if (message.streamingSidecar != null && message.hasOwnProperty("streamingSidecar")) + if (!(message.streamingSidecar && typeof message.streamingSidecar.length === "number" || $util.isString(message.streamingSidecar))) + return "streamingSidecar: buffer expected"; + if (message.gifAttribution != null && message.hasOwnProperty("gifAttribution")) + switch (message.gifAttribution) { + default: + return "gifAttribution: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a VideoMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.VideoMessage + * @static + * @param {Object.} object Plain object + * @returns {proto.VideoMessage} VideoMessage + */ + VideoMessage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.VideoMessage) + return object; + var message = new $root.proto.VideoMessage(); + if (object.url != null) + message.url = String(object.url); + if (object.mimetype != null) + message.mimetype = String(object.mimetype); + if (object.fileSha256 != null) + if (typeof object.fileSha256 === "string") + $util.base64.decode(object.fileSha256, message.fileSha256 = $util.newBuffer($util.base64.length(object.fileSha256)), 0); + else if (object.fileSha256.length) + message.fileSha256 = object.fileSha256; + if (object.fileLength != null) + if ($util.Long) + (message.fileLength = $util.Long.fromValue(object.fileLength)).unsigned = true; + else if (typeof object.fileLength === "string") + message.fileLength = parseInt(object.fileLength, 10); + else if (typeof object.fileLength === "number") + message.fileLength = object.fileLength; + else if (typeof object.fileLength === "object") + message.fileLength = new $util.LongBits(object.fileLength.low >>> 0, object.fileLength.high >>> 0).toNumber(true); + if (object.seconds != null) + message.seconds = object.seconds >>> 0; + if (object.mediaKey != null) + if (typeof object.mediaKey === "string") + $util.base64.decode(object.mediaKey, message.mediaKey = $util.newBuffer($util.base64.length(object.mediaKey)), 0); + else if (object.mediaKey.length) + message.mediaKey = object.mediaKey; + if (object.caption != null) + message.caption = String(object.caption); + if (object.gifPlayback != null) + message.gifPlayback = Boolean(object.gifPlayback); + if (object.height != null) + message.height = object.height >>> 0; + if (object.width != null) + message.width = object.width >>> 0; + if (object.fileEncSha256 != null) + if (typeof object.fileEncSha256 === "string") + $util.base64.decode(object.fileEncSha256, message.fileEncSha256 = $util.newBuffer($util.base64.length(object.fileEncSha256)), 0); + else if (object.fileEncSha256.length) + message.fileEncSha256 = object.fileEncSha256; + if (object.interactiveAnnotations) { + if (!Array.isArray(object.interactiveAnnotations)) + throw TypeError(".proto.VideoMessage.interactiveAnnotations: array expected"); + message.interactiveAnnotations = []; + for (var i = 0; i < object.interactiveAnnotations.length; ++i) { + if (typeof object.interactiveAnnotations[i] !== "object") + throw TypeError(".proto.VideoMessage.interactiveAnnotations: object expected"); + message.interactiveAnnotations[i] = $root.proto.InteractiveAnnotation.fromObject(object.interactiveAnnotations[i]); + } + } + if (object.directPath != null) + message.directPath = String(object.directPath); + if (object.mediaKeyTimestamp != null) + if ($util.Long) + (message.mediaKeyTimestamp = $util.Long.fromValue(object.mediaKeyTimestamp)).unsigned = false; + else if (typeof object.mediaKeyTimestamp === "string") + message.mediaKeyTimestamp = parseInt(object.mediaKeyTimestamp, 10); + else if (typeof object.mediaKeyTimestamp === "number") + message.mediaKeyTimestamp = object.mediaKeyTimestamp; + else if (typeof object.mediaKeyTimestamp === "object") + message.mediaKeyTimestamp = new $util.LongBits(object.mediaKeyTimestamp.low >>> 0, object.mediaKeyTimestamp.high >>> 0).toNumber(); + if (object.jpegThumbnail != null) + if (typeof object.jpegThumbnail === "string") + $util.base64.decode(object.jpegThumbnail, message.jpegThumbnail = $util.newBuffer($util.base64.length(object.jpegThumbnail)), 0); + else if (object.jpegThumbnail.length) + message.jpegThumbnail = object.jpegThumbnail; + if (object.contextInfo != null) { + if (typeof object.contextInfo !== "object") + throw TypeError(".proto.VideoMessage.contextInfo: object expected"); + message.contextInfo = $root.proto.ContextInfo.fromObject(object.contextInfo); + } + if (object.streamingSidecar != null) + if (typeof object.streamingSidecar === "string") + $util.base64.decode(object.streamingSidecar, message.streamingSidecar = $util.newBuffer($util.base64.length(object.streamingSidecar)), 0); + else if (object.streamingSidecar.length) + message.streamingSidecar = object.streamingSidecar; + switch (object.gifAttribution) { + case "NONE": + case 0: + message.gifAttribution = 0; + break; + case "GIPHY": + case 1: + message.gifAttribution = 1; + break; + case "TENOR": + case 2: + message.gifAttribution = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a VideoMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.VideoMessage + * @static + * @param {proto.VideoMessage} message VideoMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VideoMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.interactiveAnnotations = []; + if (options.defaults) { + object.url = ""; + object.mimetype = ""; + if (options.bytes === String) + object.fileSha256 = ""; + else { + object.fileSha256 = []; + if (options.bytes !== Array) + object.fileSha256 = $util.newBuffer(object.fileSha256); + } + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.fileLength = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.fileLength = options.longs === String ? "0" : 0; + object.seconds = 0; + if (options.bytes === String) + object.mediaKey = ""; + else { + object.mediaKey = []; + if (options.bytes !== Array) + object.mediaKey = $util.newBuffer(object.mediaKey); + } + object.caption = ""; + object.gifPlayback = false; + object.height = 0; + object.width = 0; + if (options.bytes === String) + object.fileEncSha256 = ""; + else { + object.fileEncSha256 = []; + if (options.bytes !== Array) + object.fileEncSha256 = $util.newBuffer(object.fileEncSha256); + } + object.directPath = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.mediaKeyTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.mediaKeyTimestamp = options.longs === String ? "0" : 0; + if (options.bytes === String) + object.jpegThumbnail = ""; + else { + object.jpegThumbnail = []; + if (options.bytes !== Array) + object.jpegThumbnail = $util.newBuffer(object.jpegThumbnail); + } + object.contextInfo = null; + if (options.bytes === String) + object.streamingSidecar = ""; + else { + object.streamingSidecar = []; + if (options.bytes !== Array) + object.streamingSidecar = $util.newBuffer(object.streamingSidecar); + } + object.gifAttribution = options.enums === String ? "NONE" : 0; + } + if (message.url != null && message.hasOwnProperty("url")) + object.url = message.url; + if (message.mimetype != null && message.hasOwnProperty("mimetype")) + object.mimetype = message.mimetype; + if (message.fileSha256 != null && message.hasOwnProperty("fileSha256")) + object.fileSha256 = options.bytes === String ? $util.base64.encode(message.fileSha256, 0, message.fileSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.fileSha256) : message.fileSha256; + if (message.fileLength != null && message.hasOwnProperty("fileLength")) + if (typeof message.fileLength === "number") + object.fileLength = options.longs === String ? String(message.fileLength) : message.fileLength; + else + object.fileLength = options.longs === String ? $util.Long.prototype.toString.call(message.fileLength) : options.longs === Number ? new $util.LongBits(message.fileLength.low >>> 0, message.fileLength.high >>> 0).toNumber(true) : message.fileLength; + if (message.seconds != null && message.hasOwnProperty("seconds")) + object.seconds = message.seconds; + if (message.mediaKey != null && message.hasOwnProperty("mediaKey")) + object.mediaKey = options.bytes === String ? $util.base64.encode(message.mediaKey, 0, message.mediaKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.mediaKey) : message.mediaKey; + if (message.caption != null && message.hasOwnProperty("caption")) + object.caption = message.caption; + if (message.gifPlayback != null && message.hasOwnProperty("gifPlayback")) + object.gifPlayback = message.gifPlayback; + if (message.height != null && message.hasOwnProperty("height")) + object.height = message.height; + if (message.width != null && message.hasOwnProperty("width")) + object.width = message.width; + if (message.fileEncSha256 != null && message.hasOwnProperty("fileEncSha256")) + object.fileEncSha256 = options.bytes === String ? $util.base64.encode(message.fileEncSha256, 0, message.fileEncSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.fileEncSha256) : message.fileEncSha256; + if (message.interactiveAnnotations && message.interactiveAnnotations.length) { + object.interactiveAnnotations = []; + for (var j = 0; j < message.interactiveAnnotations.length; ++j) + object.interactiveAnnotations[j] = $root.proto.InteractiveAnnotation.toObject(message.interactiveAnnotations[j], options); + } + if (message.directPath != null && message.hasOwnProperty("directPath")) + object.directPath = message.directPath; + if (message.mediaKeyTimestamp != null && message.hasOwnProperty("mediaKeyTimestamp")) + if (typeof message.mediaKeyTimestamp === "number") + object.mediaKeyTimestamp = options.longs === String ? String(message.mediaKeyTimestamp) : message.mediaKeyTimestamp; + else + object.mediaKeyTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.mediaKeyTimestamp) : options.longs === Number ? new $util.LongBits(message.mediaKeyTimestamp.low >>> 0, message.mediaKeyTimestamp.high >>> 0).toNumber() : message.mediaKeyTimestamp; + if (message.jpegThumbnail != null && message.hasOwnProperty("jpegThumbnail")) + object.jpegThumbnail = options.bytes === String ? $util.base64.encode(message.jpegThumbnail, 0, message.jpegThumbnail.length) : options.bytes === Array ? Array.prototype.slice.call(message.jpegThumbnail) : message.jpegThumbnail; + if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) + object.contextInfo = $root.proto.ContextInfo.toObject(message.contextInfo, options); + if (message.streamingSidecar != null && message.hasOwnProperty("streamingSidecar")) + object.streamingSidecar = options.bytes === String ? $util.base64.encode(message.streamingSidecar, 0, message.streamingSidecar.length) : options.bytes === Array ? Array.prototype.slice.call(message.streamingSidecar) : message.streamingSidecar; + if (message.gifAttribution != null && message.hasOwnProperty("gifAttribution")) + object.gifAttribution = options.enums === String ? $root.proto.VideoMessage.VIDEO_MESSAGE_ATTRIBUTION[message.gifAttribution] : message.gifAttribution; + return object; + }; + + /** + * Converts this VideoMessage to JSON. + * @function toJSON + * @memberof proto.VideoMessage + * @instance + * @returns {Object.} JSON object + */ + VideoMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * VIDEO_MESSAGE_ATTRIBUTION enum. + * @name proto.VideoMessage.VIDEO_MESSAGE_ATTRIBUTION + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} GIPHY=1 GIPHY value + * @property {number} TENOR=2 TENOR value + */ + VideoMessage.VIDEO_MESSAGE_ATTRIBUTION = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "GIPHY"] = 1; + values[valuesById[2] = "TENOR"] = 2; + return values; + })(); + + return VideoMessage; + })(); + + proto.Call = (function() { + + /** + * Properties of a Call. + * @memberof proto + * @interface ICall + * @property {Uint8Array|null} [callKey] Call callKey + */ + + /** + * Constructs a new Call. + * @memberof proto + * @classdesc Represents a Call. + * @implements ICall + * @constructor + * @param {proto.ICall=} [properties] Properties to set + */ + function Call(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Call callKey. + * @member {Uint8Array} callKey + * @memberof proto.Call + * @instance + */ + Call.prototype.callKey = $util.newBuffer([]); + + /** + * Creates a new Call instance using the specified properties. + * @function create + * @memberof proto.Call + * @static + * @param {proto.ICall=} [properties] Properties to set + * @returns {proto.Call} Call instance + */ + Call.create = function create(properties) { + return new Call(properties); + }; + + /** + * Encodes the specified Call message. Does not implicitly {@link proto.Call.verify|verify} messages. + * @function encode + * @memberof proto.Call + * @static + * @param {proto.ICall} message Call message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Call.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.callKey != null && Object.hasOwnProperty.call(message, "callKey")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.callKey); + return writer; + }; + + /** + * Encodes the specified Call message, length delimited. Does not implicitly {@link proto.Call.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.Call + * @static + * @param {proto.ICall} message Call message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Call.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Call message from the specified reader or buffer. + * @function decode + * @memberof proto.Call + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.Call} Call + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Call.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.Call(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.callKey = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Call message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.Call + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.Call} Call + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Call.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Call message. + * @function verify + * @memberof proto.Call + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Call.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.callKey != null && message.hasOwnProperty("callKey")) + if (!(message.callKey && typeof message.callKey.length === "number" || $util.isString(message.callKey))) + return "callKey: buffer expected"; + return null; + }; + + /** + * Creates a Call message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.Call + * @static + * @param {Object.} object Plain object + * @returns {proto.Call} Call + */ + Call.fromObject = function fromObject(object) { + if (object instanceof $root.proto.Call) + return object; + var message = new $root.proto.Call(); + if (object.callKey != null) + if (typeof object.callKey === "string") + $util.base64.decode(object.callKey, message.callKey = $util.newBuffer($util.base64.length(object.callKey)), 0); + else if (object.callKey.length) + message.callKey = object.callKey; + return message; + }; + + /** + * Creates a plain object from a Call message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.Call + * @static + * @param {proto.Call} message Call + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Call.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.callKey = ""; + else { + object.callKey = []; + if (options.bytes !== Array) + object.callKey = $util.newBuffer(object.callKey); + } + if (message.callKey != null && message.hasOwnProperty("callKey")) + object.callKey = options.bytes === String ? $util.base64.encode(message.callKey, 0, message.callKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.callKey) : message.callKey; + return object; + }; + + /** + * Converts this Call to JSON. + * @function toJSON + * @memberof proto.Call + * @instance + * @returns {Object.} JSON object + */ + Call.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Call; + })(); + + proto.Chat = (function() { + + /** + * Properties of a Chat. + * @memberof proto + * @interface IChat + * @property {string|null} [displayName] Chat displayName + * @property {string|null} [id] Chat id + */ + + /** + * Constructs a new Chat. + * @memberof proto + * @classdesc Represents a Chat. + * @implements IChat + * @constructor + * @param {proto.IChat=} [properties] Properties to set + */ + function Chat(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Chat displayName. + * @member {string} displayName + * @memberof proto.Chat + * @instance + */ + Chat.prototype.displayName = ""; + + /** + * Chat id. + * @member {string} id + * @memberof proto.Chat + * @instance + */ + Chat.prototype.id = ""; + + /** + * Creates a new Chat instance using the specified properties. + * @function create + * @memberof proto.Chat + * @static + * @param {proto.IChat=} [properties] Properties to set + * @returns {proto.Chat} Chat instance + */ + Chat.create = function create(properties) { + return new Chat(properties); + }; + + /** + * Encodes the specified Chat message. Does not implicitly {@link proto.Chat.verify|verify} messages. + * @function encode + * @memberof proto.Chat + * @static + * @param {proto.IChat} message Chat message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Chat.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayName); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.id); + return writer; + }; + + /** + * Encodes the specified Chat message, length delimited. Does not implicitly {@link proto.Chat.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.Chat + * @static + * @param {proto.IChat} message Chat message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Chat.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Chat message from the specified reader or buffer. + * @function decode + * @memberof proto.Chat + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.Chat} Chat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Chat.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.Chat(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.displayName = reader.string(); + break; + case 2: + message.id = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Chat message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.Chat + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.Chat} Chat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Chat.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Chat message. + * @function verify + * @memberof proto.Chat + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Chat.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + return null; + }; + + /** + * Creates a Chat message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.Chat + * @static + * @param {Object.} object Plain object + * @returns {proto.Chat} Chat + */ + Chat.fromObject = function fromObject(object) { + if (object instanceof $root.proto.Chat) + return object; + var message = new $root.proto.Chat(); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.id != null) + message.id = String(object.id); + return message; + }; + + /** + * Creates a plain object from a Chat message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.Chat + * @static + * @param {proto.Chat} message Chat + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Chat.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.displayName = ""; + object.id = ""; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + return object; + }; + + /** + * Converts this Chat to JSON. + * @function toJSON + * @memberof proto.Chat + * @instance + * @returns {Object.} JSON object + */ + Chat.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Chat; + })(); + + proto.ProtocolMessage = (function() { + + /** + * Properties of a ProtocolMessage. + * @memberof proto + * @interface IProtocolMessage + * @property {proto.IMessageKey|null} [key] ProtocolMessage key + * @property {proto.ProtocolMessage.PROTOCOL_MESSAGE_TYPE|null} [type] ProtocolMessage type + * @property {number|null} [ephemeralExpiration] ProtocolMessage ephemeralExpiration + */ + + /** + * Constructs a new ProtocolMessage. + * @memberof proto + * @classdesc Represents a ProtocolMessage. + * @implements IProtocolMessage + * @constructor + * @param {proto.IProtocolMessage=} [properties] Properties to set + */ + function ProtocolMessage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ProtocolMessage key. + * @member {proto.IMessageKey|null|undefined} key + * @memberof proto.ProtocolMessage + * @instance + */ + ProtocolMessage.prototype.key = null; + + /** + * ProtocolMessage type. + * @member {proto.ProtocolMessage.PROTOCOL_MESSAGE_TYPE} type + * @memberof proto.ProtocolMessage + * @instance + */ + ProtocolMessage.prototype.type = 0; + + /** + * ProtocolMessage ephemeralExpiration. + * @member {number} ephemeralExpiration + * @memberof proto.ProtocolMessage + * @instance + */ + ProtocolMessage.prototype.ephemeralExpiration = 0; + + /** + * Creates a new ProtocolMessage instance using the specified properties. + * @function create + * @memberof proto.ProtocolMessage + * @static + * @param {proto.IProtocolMessage=} [properties] Properties to set + * @returns {proto.ProtocolMessage} ProtocolMessage instance + */ + ProtocolMessage.create = function create(properties) { + return new ProtocolMessage(properties); + }; + + /** + * Encodes the specified ProtocolMessage message. Does not implicitly {@link proto.ProtocolMessage.verify|verify} messages. + * @function encode + * @memberof proto.ProtocolMessage + * @static + * @param {proto.IProtocolMessage} message ProtocolMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProtocolMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + $root.proto.MessageKey.encode(message.key, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type); + if (message.ephemeralExpiration != null && Object.hasOwnProperty.call(message, "ephemeralExpiration")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.ephemeralExpiration); + return writer; + }; + + /** + * Encodes the specified ProtocolMessage message, length delimited. Does not implicitly {@link proto.ProtocolMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.ProtocolMessage + * @static + * @param {proto.IProtocolMessage} message ProtocolMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProtocolMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProtocolMessage message from the specified reader or buffer. + * @function decode + * @memberof proto.ProtocolMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.ProtocolMessage} ProtocolMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProtocolMessage.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ProtocolMessage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = $root.proto.MessageKey.decode(reader, reader.uint32()); + break; + case 2: + message.type = reader.int32(); + break; + case 4: + message.ephemeralExpiration = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProtocolMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.ProtocolMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.ProtocolMessage} ProtocolMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProtocolMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProtocolMessage message. + * @function verify + * @memberof proto.ProtocolMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProtocolMessage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) { + var error = $root.proto.MessageKey.verify(message.key); + if (error) + return "key." + error; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 3: + break; + } + if (message.ephemeralExpiration != null && message.hasOwnProperty("ephemeralExpiration")) + if (!$util.isInteger(message.ephemeralExpiration)) + return "ephemeralExpiration: integer expected"; + return null; + }; + + /** + * Creates a ProtocolMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.ProtocolMessage + * @static + * @param {Object.} object Plain object + * @returns {proto.ProtocolMessage} ProtocolMessage + */ + ProtocolMessage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.ProtocolMessage) + return object; + var message = new $root.proto.ProtocolMessage(); + if (object.key != null) { + if (typeof object.key !== "object") + throw TypeError(".proto.ProtocolMessage.key: object expected"); + message.key = $root.proto.MessageKey.fromObject(object.key); + } + switch (object.type) { + case "REVOKE": + case 0: + message.type = 0; + break; + case "EPHEMERAL_SETTING": + case 3: + message.type = 3; + break; + } + if (object.ephemeralExpiration != null) + message.ephemeralExpiration = object.ephemeralExpiration >>> 0; + return message; + }; + + /** + * Creates a plain object from a ProtocolMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.ProtocolMessage + * @static + * @param {proto.ProtocolMessage} message ProtocolMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProtocolMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.key = null; + object.type = options.enums === String ? "REVOKE" : 0; + object.ephemeralExpiration = 0; + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = $root.proto.MessageKey.toObject(message.key, options); + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.proto.ProtocolMessage.PROTOCOL_MESSAGE_TYPE[message.type] : message.type; + if (message.ephemeralExpiration != null && message.hasOwnProperty("ephemeralExpiration")) + object.ephemeralExpiration = message.ephemeralExpiration; + return object; + }; + + /** + * Converts this ProtocolMessage to JSON. + * @function toJSON + * @memberof proto.ProtocolMessage + * @instance + * @returns {Object.} JSON object + */ + ProtocolMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * PROTOCOL_MESSAGE_TYPE enum. + * @name proto.ProtocolMessage.PROTOCOL_MESSAGE_TYPE + * @enum {number} + * @property {number} REVOKE=0 REVOKE value + * @property {number} EPHEMERAL_SETTING=3 EPHEMERAL_SETTING value + */ + ProtocolMessage.PROTOCOL_MESSAGE_TYPE = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REVOKE"] = 0; + values[valuesById[3] = "EPHEMERAL_SETTING"] = 3; + return values; + })(); + + return ProtocolMessage; + })(); + + proto.ContactsArrayMessage = (function() { + + /** + * Properties of a ContactsArrayMessage. + * @memberof proto + * @interface IContactsArrayMessage + * @property {string|null} [displayName] ContactsArrayMessage displayName + * @property {Array.|null} [contacts] ContactsArrayMessage contacts + * @property {proto.IContextInfo|null} [contextInfo] ContactsArrayMessage contextInfo + */ + + /** + * Constructs a new ContactsArrayMessage. + * @memberof proto + * @classdesc Represents a ContactsArrayMessage. + * @implements IContactsArrayMessage + * @constructor + * @param {proto.IContactsArrayMessage=} [properties] Properties to set + */ + function ContactsArrayMessage(properties) { + this.contacts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ContactsArrayMessage displayName. + * @member {string} displayName + * @memberof proto.ContactsArrayMessage + * @instance + */ + ContactsArrayMessage.prototype.displayName = ""; + + /** + * ContactsArrayMessage contacts. + * @member {Array.} contacts + * @memberof proto.ContactsArrayMessage + * @instance + */ + ContactsArrayMessage.prototype.contacts = $util.emptyArray; + + /** + * ContactsArrayMessage contextInfo. + * @member {proto.IContextInfo|null|undefined} contextInfo + * @memberof proto.ContactsArrayMessage + * @instance + */ + ContactsArrayMessage.prototype.contextInfo = null; + + /** + * Creates a new ContactsArrayMessage instance using the specified properties. + * @function create + * @memberof proto.ContactsArrayMessage + * @static + * @param {proto.IContactsArrayMessage=} [properties] Properties to set + * @returns {proto.ContactsArrayMessage} ContactsArrayMessage instance + */ + ContactsArrayMessage.create = function create(properties) { + return new ContactsArrayMessage(properties); + }; + + /** + * Encodes the specified ContactsArrayMessage message. Does not implicitly {@link proto.ContactsArrayMessage.verify|verify} messages. + * @function encode + * @memberof proto.ContactsArrayMessage + * @static + * @param {proto.IContactsArrayMessage} message ContactsArrayMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContactsArrayMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayName); + if (message.contacts != null && message.contacts.length) + for (var i = 0; i < message.contacts.length; ++i) + $root.proto.ContactMessage.encode(message.contacts[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.contextInfo != null && Object.hasOwnProperty.call(message, "contextInfo")) + $root.proto.ContextInfo.encode(message.contextInfo, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ContactsArrayMessage message, length delimited. Does not implicitly {@link proto.ContactsArrayMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.ContactsArrayMessage + * @static + * @param {proto.IContactsArrayMessage} message ContactsArrayMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContactsArrayMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContactsArrayMessage message from the specified reader or buffer. + * @function decode + * @memberof proto.ContactsArrayMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.ContactsArrayMessage} ContactsArrayMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContactsArrayMessage.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ContactsArrayMessage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.displayName = reader.string(); + break; + case 2: + if (!(message.contacts && message.contacts.length)) + message.contacts = []; + message.contacts.push($root.proto.ContactMessage.decode(reader, reader.uint32())); + break; + case 17: + message.contextInfo = $root.proto.ContextInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContactsArrayMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.ContactsArrayMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.ContactsArrayMessage} ContactsArrayMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContactsArrayMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContactsArrayMessage message. + * @function verify + * @memberof proto.ContactsArrayMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContactsArrayMessage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.contacts != null && message.hasOwnProperty("contacts")) { + if (!Array.isArray(message.contacts)) + return "contacts: array expected"; + for (var i = 0; i < message.contacts.length; ++i) { + var error = $root.proto.ContactMessage.verify(message.contacts[i]); + if (error) + return "contacts." + error; + } + } + if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) { + var error = $root.proto.ContextInfo.verify(message.contextInfo); + if (error) + return "contextInfo." + error; + } + return null; + }; + + /** + * Creates a ContactsArrayMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.ContactsArrayMessage + * @static + * @param {Object.} object Plain object + * @returns {proto.ContactsArrayMessage} ContactsArrayMessage + */ + ContactsArrayMessage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.ContactsArrayMessage) + return object; + var message = new $root.proto.ContactsArrayMessage(); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.contacts) { + if (!Array.isArray(object.contacts)) + throw TypeError(".proto.ContactsArrayMessage.contacts: array expected"); + message.contacts = []; + for (var i = 0; i < object.contacts.length; ++i) { + if (typeof object.contacts[i] !== "object") + throw TypeError(".proto.ContactsArrayMessage.contacts: object expected"); + message.contacts[i] = $root.proto.ContactMessage.fromObject(object.contacts[i]); + } + } + if (object.contextInfo != null) { + if (typeof object.contextInfo !== "object") + throw TypeError(".proto.ContactsArrayMessage.contextInfo: object expected"); + message.contextInfo = $root.proto.ContextInfo.fromObject(object.contextInfo); + } + return message; + }; + + /** + * Creates a plain object from a ContactsArrayMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.ContactsArrayMessage + * @static + * @param {proto.ContactsArrayMessage} message ContactsArrayMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContactsArrayMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.contacts = []; + if (options.defaults) { + object.displayName = ""; + object.contextInfo = null; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.contacts && message.contacts.length) { + object.contacts = []; + for (var j = 0; j < message.contacts.length; ++j) + object.contacts[j] = $root.proto.ContactMessage.toObject(message.contacts[j], options); + } + if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) + object.contextInfo = $root.proto.ContextInfo.toObject(message.contextInfo, options); + return object; + }; + + /** + * Converts this ContactsArrayMessage to JSON. + * @function toJSON + * @memberof proto.ContactsArrayMessage + * @instance + * @returns {Object.} JSON object + */ + ContactsArrayMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ContactsArrayMessage; + })(); + + proto.HSMCurrency = (function() { + + /** + * Properties of a HSMCurrency. + * @memberof proto + * @interface IHSMCurrency + * @property {string|null} [currencyCode] HSMCurrency currencyCode + * @property {number|Long|null} [amount1000] HSMCurrency amount1000 + */ + + /** + * Constructs a new HSMCurrency. + * @memberof proto + * @classdesc Represents a HSMCurrency. + * @implements IHSMCurrency + * @constructor + * @param {proto.IHSMCurrency=} [properties] Properties to set + */ + function HSMCurrency(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HSMCurrency currencyCode. + * @member {string} currencyCode + * @memberof proto.HSMCurrency + * @instance + */ + HSMCurrency.prototype.currencyCode = ""; + + /** + * HSMCurrency amount1000. + * @member {number|Long} amount1000 + * @memberof proto.HSMCurrency + * @instance + */ + HSMCurrency.prototype.amount1000 = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new HSMCurrency instance using the specified properties. + * @function create + * @memberof proto.HSMCurrency + * @static + * @param {proto.IHSMCurrency=} [properties] Properties to set + * @returns {proto.HSMCurrency} HSMCurrency instance + */ + HSMCurrency.create = function create(properties) { + return new HSMCurrency(properties); + }; + + /** + * Encodes the specified HSMCurrency message. Does not implicitly {@link proto.HSMCurrency.verify|verify} messages. + * @function encode + * @memberof proto.HSMCurrency + * @static + * @param {proto.IHSMCurrency} message HSMCurrency message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HSMCurrency.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.currencyCode != null && Object.hasOwnProperty.call(message, "currencyCode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.currencyCode); + if (message.amount1000 != null && Object.hasOwnProperty.call(message, "amount1000")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.amount1000); + return writer; + }; + + /** + * Encodes the specified HSMCurrency message, length delimited. Does not implicitly {@link proto.HSMCurrency.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.HSMCurrency + * @static + * @param {proto.IHSMCurrency} message HSMCurrency message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HSMCurrency.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HSMCurrency message from the specified reader or buffer. + * @function decode + * @memberof proto.HSMCurrency + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.HSMCurrency} HSMCurrency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HSMCurrency.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.HSMCurrency(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.currencyCode = reader.string(); + break; + case 2: + message.amount1000 = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HSMCurrency message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.HSMCurrency + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.HSMCurrency} HSMCurrency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HSMCurrency.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HSMCurrency message. + * @function verify + * @memberof proto.HSMCurrency + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HSMCurrency.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) + if (!$util.isString(message.currencyCode)) + return "currencyCode: string expected"; + if (message.amount1000 != null && message.hasOwnProperty("amount1000")) + if (!$util.isInteger(message.amount1000) && !(message.amount1000 && $util.isInteger(message.amount1000.low) && $util.isInteger(message.amount1000.high))) + return "amount1000: integer|Long expected"; + return null; + }; + + /** + * Creates a HSMCurrency message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.HSMCurrency + * @static + * @param {Object.} object Plain object + * @returns {proto.HSMCurrency} HSMCurrency + */ + HSMCurrency.fromObject = function fromObject(object) { + if (object instanceof $root.proto.HSMCurrency) + return object; + var message = new $root.proto.HSMCurrency(); + if (object.currencyCode != null) + message.currencyCode = String(object.currencyCode); + if (object.amount1000 != null) + if ($util.Long) + (message.amount1000 = $util.Long.fromValue(object.amount1000)).unsigned = false; + else if (typeof object.amount1000 === "string") + message.amount1000 = parseInt(object.amount1000, 10); + else if (typeof object.amount1000 === "number") + message.amount1000 = object.amount1000; + else if (typeof object.amount1000 === "object") + message.amount1000 = new $util.LongBits(object.amount1000.low >>> 0, object.amount1000.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a HSMCurrency message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.HSMCurrency + * @static + * @param {proto.HSMCurrency} message HSMCurrency + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HSMCurrency.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.currencyCode = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.amount1000 = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.amount1000 = options.longs === String ? "0" : 0; + } + if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) + object.currencyCode = message.currencyCode; + if (message.amount1000 != null && message.hasOwnProperty("amount1000")) + if (typeof message.amount1000 === "number") + object.amount1000 = options.longs === String ? String(message.amount1000) : message.amount1000; + else + object.amount1000 = options.longs === String ? $util.Long.prototype.toString.call(message.amount1000) : options.longs === Number ? new $util.LongBits(message.amount1000.low >>> 0, message.amount1000.high >>> 0).toNumber() : message.amount1000; + return object; + }; + + /** + * Converts this HSMCurrency to JSON. + * @function toJSON + * @memberof proto.HSMCurrency + * @instance + * @returns {Object.} JSON object + */ + HSMCurrency.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return HSMCurrency; + })(); + + proto.HSMDateTimeComponent = (function() { + + /** + * Properties of a HSMDateTimeComponent. + * @memberof proto + * @interface IHSMDateTimeComponent + * @property {proto.HSMDateTimeComponent.HSM_DATE_TIME_COMPONENT_DAYOFWEEKTYPE|null} [dayOfWeek] HSMDateTimeComponent dayOfWeek + * @property {number|null} [year] HSMDateTimeComponent year + * @property {number|null} [month] HSMDateTimeComponent month + * @property {number|null} [dayOfMonth] HSMDateTimeComponent dayOfMonth + * @property {number|null} [hour] HSMDateTimeComponent hour + * @property {number|null} [minute] HSMDateTimeComponent minute + * @property {proto.HSMDateTimeComponent.HSM_DATE_TIME_COMPONENT_CALENDARTYPE|null} [calendar] HSMDateTimeComponent calendar + */ + + /** + * Constructs a new HSMDateTimeComponent. + * @memberof proto + * @classdesc Represents a HSMDateTimeComponent. + * @implements IHSMDateTimeComponent + * @constructor + * @param {proto.IHSMDateTimeComponent=} [properties] Properties to set + */ + function HSMDateTimeComponent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HSMDateTimeComponent dayOfWeek. + * @member {proto.HSMDateTimeComponent.HSM_DATE_TIME_COMPONENT_DAYOFWEEKTYPE} dayOfWeek + * @memberof proto.HSMDateTimeComponent + * @instance + */ + HSMDateTimeComponent.prototype.dayOfWeek = 1; + + /** + * HSMDateTimeComponent year. + * @member {number} year + * @memberof proto.HSMDateTimeComponent + * @instance + */ + HSMDateTimeComponent.prototype.year = 0; + + /** + * HSMDateTimeComponent month. + * @member {number} month + * @memberof proto.HSMDateTimeComponent + * @instance + */ + HSMDateTimeComponent.prototype.month = 0; + + /** + * HSMDateTimeComponent dayOfMonth. + * @member {number} dayOfMonth + * @memberof proto.HSMDateTimeComponent + * @instance + */ + HSMDateTimeComponent.prototype.dayOfMonth = 0; + + /** + * HSMDateTimeComponent hour. + * @member {number} hour + * @memberof proto.HSMDateTimeComponent + * @instance + */ + HSMDateTimeComponent.prototype.hour = 0; + + /** + * HSMDateTimeComponent minute. + * @member {number} minute + * @memberof proto.HSMDateTimeComponent + * @instance + */ + HSMDateTimeComponent.prototype.minute = 0; + + /** + * HSMDateTimeComponent calendar. + * @member {proto.HSMDateTimeComponent.HSM_DATE_TIME_COMPONENT_CALENDARTYPE} calendar + * @memberof proto.HSMDateTimeComponent + * @instance + */ + HSMDateTimeComponent.prototype.calendar = 1; + + /** + * Creates a new HSMDateTimeComponent instance using the specified properties. + * @function create + * @memberof proto.HSMDateTimeComponent + * @static + * @param {proto.IHSMDateTimeComponent=} [properties] Properties to set + * @returns {proto.HSMDateTimeComponent} HSMDateTimeComponent instance + */ + HSMDateTimeComponent.create = function create(properties) { + return new HSMDateTimeComponent(properties); + }; + + /** + * Encodes the specified HSMDateTimeComponent message. Does not implicitly {@link proto.HSMDateTimeComponent.verify|verify} messages. + * @function encode + * @memberof proto.HSMDateTimeComponent + * @static + * @param {proto.IHSMDateTimeComponent} message HSMDateTimeComponent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HSMDateTimeComponent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dayOfWeek != null && Object.hasOwnProperty.call(message, "dayOfWeek")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.dayOfWeek); + if (message.year != null && Object.hasOwnProperty.call(message, "year")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.year); + if (message.month != null && Object.hasOwnProperty.call(message, "month")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.month); + if (message.dayOfMonth != null && Object.hasOwnProperty.call(message, "dayOfMonth")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.dayOfMonth); + if (message.hour != null && Object.hasOwnProperty.call(message, "hour")) + writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.hour); + if (message.minute != null && Object.hasOwnProperty.call(message, "minute")) + writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.minute); + if (message.calendar != null && Object.hasOwnProperty.call(message, "calendar")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.calendar); + return writer; + }; + + /** + * Encodes the specified HSMDateTimeComponent message, length delimited. Does not implicitly {@link proto.HSMDateTimeComponent.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.HSMDateTimeComponent + * @static + * @param {proto.IHSMDateTimeComponent} message HSMDateTimeComponent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HSMDateTimeComponent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HSMDateTimeComponent message from the specified reader or buffer. + * @function decode + * @memberof proto.HSMDateTimeComponent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.HSMDateTimeComponent} HSMDateTimeComponent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HSMDateTimeComponent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.HSMDateTimeComponent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.dayOfWeek = reader.int32(); + break; + case 2: + message.year = reader.uint32(); + break; + case 3: + message.month = reader.uint32(); + break; + case 4: + message.dayOfMonth = reader.uint32(); + break; + case 5: + message.hour = reader.uint32(); + break; + case 6: + message.minute = reader.uint32(); + break; + case 7: + message.calendar = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HSMDateTimeComponent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.HSMDateTimeComponent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.HSMDateTimeComponent} HSMDateTimeComponent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HSMDateTimeComponent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HSMDateTimeComponent message. + * @function verify + * @memberof proto.HSMDateTimeComponent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HSMDateTimeComponent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dayOfWeek != null && message.hasOwnProperty("dayOfWeek")) + switch (message.dayOfWeek) { + default: + return "dayOfWeek: enum value expected"; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.year != null && message.hasOwnProperty("year")) + if (!$util.isInteger(message.year)) + return "year: integer expected"; + if (message.month != null && message.hasOwnProperty("month")) + if (!$util.isInteger(message.month)) + return "month: integer expected"; + if (message.dayOfMonth != null && message.hasOwnProperty("dayOfMonth")) + if (!$util.isInteger(message.dayOfMonth)) + return "dayOfMonth: integer expected"; + if (message.hour != null && message.hasOwnProperty("hour")) + if (!$util.isInteger(message.hour)) + return "hour: integer expected"; + if (message.minute != null && message.hasOwnProperty("minute")) + if (!$util.isInteger(message.minute)) + return "minute: integer expected"; + if (message.calendar != null && message.hasOwnProperty("calendar")) + switch (message.calendar) { + default: + return "calendar: enum value expected"; + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a HSMDateTimeComponent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.HSMDateTimeComponent + * @static + * @param {Object.} object Plain object + * @returns {proto.HSMDateTimeComponent} HSMDateTimeComponent + */ + HSMDateTimeComponent.fromObject = function fromObject(object) { + if (object instanceof $root.proto.HSMDateTimeComponent) + return object; + var message = new $root.proto.HSMDateTimeComponent(); + switch (object.dayOfWeek) { + case "MONDAY": + case 1: + message.dayOfWeek = 1; + break; + case "TUESDAY": + case 2: + message.dayOfWeek = 2; + break; + case "WEDNESDAY": + case 3: + message.dayOfWeek = 3; + break; + case "THURSDAY": + case 4: + message.dayOfWeek = 4; + break; + case "FRIDAY": + case 5: + message.dayOfWeek = 5; + break; + case "SATURDAY": + case 6: + message.dayOfWeek = 6; + break; + case "SUNDAY": + case 7: + message.dayOfWeek = 7; + break; + } + if (object.year != null) + message.year = object.year >>> 0; + if (object.month != null) + message.month = object.month >>> 0; + if (object.dayOfMonth != null) + message.dayOfMonth = object.dayOfMonth >>> 0; + if (object.hour != null) + message.hour = object.hour >>> 0; + if (object.minute != null) + message.minute = object.minute >>> 0; + switch (object.calendar) { + case "GREGORIAN": + case 1: + message.calendar = 1; + break; + case "SOLAR_HIJRI": + case 2: + message.calendar = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a HSMDateTimeComponent message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.HSMDateTimeComponent + * @static + * @param {proto.HSMDateTimeComponent} message HSMDateTimeComponent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HSMDateTimeComponent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.dayOfWeek = options.enums === String ? "MONDAY" : 1; + object.year = 0; + object.month = 0; + object.dayOfMonth = 0; + object.hour = 0; + object.minute = 0; + object.calendar = options.enums === String ? "GREGORIAN" : 1; + } + if (message.dayOfWeek != null && message.hasOwnProperty("dayOfWeek")) + object.dayOfWeek = options.enums === String ? $root.proto.HSMDateTimeComponent.HSM_DATE_TIME_COMPONENT_DAYOFWEEKTYPE[message.dayOfWeek] : message.dayOfWeek; + if (message.year != null && message.hasOwnProperty("year")) + object.year = message.year; + if (message.month != null && message.hasOwnProperty("month")) + object.month = message.month; + if (message.dayOfMonth != null && message.hasOwnProperty("dayOfMonth")) + object.dayOfMonth = message.dayOfMonth; + if (message.hour != null && message.hasOwnProperty("hour")) + object.hour = message.hour; + if (message.minute != null && message.hasOwnProperty("minute")) + object.minute = message.minute; + if (message.calendar != null && message.hasOwnProperty("calendar")) + object.calendar = options.enums === String ? $root.proto.HSMDateTimeComponent.HSM_DATE_TIME_COMPONENT_CALENDARTYPE[message.calendar] : message.calendar; + return object; + }; + + /** + * Converts this HSMDateTimeComponent to JSON. + * @function toJSON + * @memberof proto.HSMDateTimeComponent + * @instance + * @returns {Object.} JSON object + */ + HSMDateTimeComponent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * HSM_DATE_TIME_COMPONENT_DAYOFWEEKTYPE enum. + * @name proto.HSMDateTimeComponent.HSM_DATE_TIME_COMPONENT_DAYOFWEEKTYPE + * @enum {number} + * @property {number} MONDAY=1 MONDAY value + * @property {number} TUESDAY=2 TUESDAY value + * @property {number} WEDNESDAY=3 WEDNESDAY value + * @property {number} THURSDAY=4 THURSDAY value + * @property {number} FRIDAY=5 FRIDAY value + * @property {number} SATURDAY=6 SATURDAY value + * @property {number} SUNDAY=7 SUNDAY value + */ + HSMDateTimeComponent.HSM_DATE_TIME_COMPONENT_DAYOFWEEKTYPE = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "MONDAY"] = 1; + values[valuesById[2] = "TUESDAY"] = 2; + values[valuesById[3] = "WEDNESDAY"] = 3; + values[valuesById[4] = "THURSDAY"] = 4; + values[valuesById[5] = "FRIDAY"] = 5; + values[valuesById[6] = "SATURDAY"] = 6; + values[valuesById[7] = "SUNDAY"] = 7; + return values; + })(); + + /** + * HSM_DATE_TIME_COMPONENT_CALENDARTYPE enum. + * @name proto.HSMDateTimeComponent.HSM_DATE_TIME_COMPONENT_CALENDARTYPE + * @enum {number} + * @property {number} GREGORIAN=1 GREGORIAN value + * @property {number} SOLAR_HIJRI=2 SOLAR_HIJRI value + */ + HSMDateTimeComponent.HSM_DATE_TIME_COMPONENT_CALENDARTYPE = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "GREGORIAN"] = 1; + values[valuesById[2] = "SOLAR_HIJRI"] = 2; + return values; + })(); + + return HSMDateTimeComponent; + })(); + + proto.HSMDateTimeUnixEpoch = (function() { + + /** + * Properties of a HSMDateTimeUnixEpoch. + * @memberof proto + * @interface IHSMDateTimeUnixEpoch + * @property {number|Long|null} [timestamp] HSMDateTimeUnixEpoch timestamp + */ + + /** + * Constructs a new HSMDateTimeUnixEpoch. + * @memberof proto + * @classdesc Represents a HSMDateTimeUnixEpoch. + * @implements IHSMDateTimeUnixEpoch + * @constructor + * @param {proto.IHSMDateTimeUnixEpoch=} [properties] Properties to set + */ + function HSMDateTimeUnixEpoch(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HSMDateTimeUnixEpoch timestamp. + * @member {number|Long} timestamp + * @memberof proto.HSMDateTimeUnixEpoch + * @instance + */ + HSMDateTimeUnixEpoch.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new HSMDateTimeUnixEpoch instance using the specified properties. + * @function create + * @memberof proto.HSMDateTimeUnixEpoch + * @static + * @param {proto.IHSMDateTimeUnixEpoch=} [properties] Properties to set + * @returns {proto.HSMDateTimeUnixEpoch} HSMDateTimeUnixEpoch instance + */ + HSMDateTimeUnixEpoch.create = function create(properties) { + return new HSMDateTimeUnixEpoch(properties); + }; + + /** + * Encodes the specified HSMDateTimeUnixEpoch message. Does not implicitly {@link proto.HSMDateTimeUnixEpoch.verify|verify} messages. + * @function encode + * @memberof proto.HSMDateTimeUnixEpoch + * @static + * @param {proto.IHSMDateTimeUnixEpoch} message HSMDateTimeUnixEpoch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HSMDateTimeUnixEpoch.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.timestamp); + return writer; + }; + + /** + * Encodes the specified HSMDateTimeUnixEpoch message, length delimited. Does not implicitly {@link proto.HSMDateTimeUnixEpoch.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.HSMDateTimeUnixEpoch + * @static + * @param {proto.IHSMDateTimeUnixEpoch} message HSMDateTimeUnixEpoch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HSMDateTimeUnixEpoch.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HSMDateTimeUnixEpoch message from the specified reader or buffer. + * @function decode + * @memberof proto.HSMDateTimeUnixEpoch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.HSMDateTimeUnixEpoch} HSMDateTimeUnixEpoch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HSMDateTimeUnixEpoch.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.HSMDateTimeUnixEpoch(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.timestamp = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HSMDateTimeUnixEpoch message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.HSMDateTimeUnixEpoch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.HSMDateTimeUnixEpoch} HSMDateTimeUnixEpoch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HSMDateTimeUnixEpoch.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HSMDateTimeUnixEpoch message. + * @function verify + * @memberof proto.HSMDateTimeUnixEpoch + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HSMDateTimeUnixEpoch.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high))) + return "timestamp: integer|Long expected"; + return null; + }; + + /** + * Creates a HSMDateTimeUnixEpoch message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.HSMDateTimeUnixEpoch + * @static + * @param {Object.} object Plain object + * @returns {proto.HSMDateTimeUnixEpoch} HSMDateTimeUnixEpoch + */ + HSMDateTimeUnixEpoch.fromObject = function fromObject(object) { + if (object instanceof $root.proto.HSMDateTimeUnixEpoch) + return object; + var message = new $root.proto.HSMDateTimeUnixEpoch(); + if (object.timestamp != null) + if ($util.Long) + (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = false; + else if (typeof object.timestamp === "string") + message.timestamp = parseInt(object.timestamp, 10); + else if (typeof object.timestamp === "number") + message.timestamp = object.timestamp; + else if (typeof object.timestamp === "object") + message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a HSMDateTimeUnixEpoch message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.HSMDateTimeUnixEpoch + * @static + * @param {proto.HSMDateTimeUnixEpoch} message HSMDateTimeUnixEpoch + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HSMDateTimeUnixEpoch.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.timestamp = options.longs === String ? "0" : 0; + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + if (typeof message.timestamp === "number") + object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp; + else + object.timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp) : options.longs === Number ? new $util.LongBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0).toNumber() : message.timestamp; + return object; + }; + + /** + * Converts this HSMDateTimeUnixEpoch to JSON. + * @function toJSON + * @memberof proto.HSMDateTimeUnixEpoch + * @instance + * @returns {Object.} JSON object + */ + HSMDateTimeUnixEpoch.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return HSMDateTimeUnixEpoch; + })(); + + proto.HSMDateTime = (function() { + + /** + * Properties of a HSMDateTime. + * @memberof proto + * @interface IHSMDateTime + * @property {proto.IHSMDateTimeComponent|null} [component] HSMDateTime component + * @property {proto.IHSMDateTimeUnixEpoch|null} [unixEpoch] HSMDateTime unixEpoch + */ + + /** + * Constructs a new HSMDateTime. + * @memberof proto + * @classdesc Represents a HSMDateTime. + * @implements IHSMDateTime + * @constructor + * @param {proto.IHSMDateTime=} [properties] Properties to set + */ + function HSMDateTime(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HSMDateTime component. + * @member {proto.IHSMDateTimeComponent|null|undefined} component + * @memberof proto.HSMDateTime + * @instance + */ + HSMDateTime.prototype.component = null; + + /** + * HSMDateTime unixEpoch. + * @member {proto.IHSMDateTimeUnixEpoch|null|undefined} unixEpoch + * @memberof proto.HSMDateTime + * @instance + */ + HSMDateTime.prototype.unixEpoch = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HSMDateTime datetimeOneof. + * @member {"component"|"unixEpoch"|undefined} datetimeOneof + * @memberof proto.HSMDateTime + * @instance + */ + Object.defineProperty(HSMDateTime.prototype, "datetimeOneof", { + get: $util.oneOfGetter($oneOfFields = ["component", "unixEpoch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HSMDateTime instance using the specified properties. + * @function create + * @memberof proto.HSMDateTime + * @static + * @param {proto.IHSMDateTime=} [properties] Properties to set + * @returns {proto.HSMDateTime} HSMDateTime instance + */ + HSMDateTime.create = function create(properties) { + return new HSMDateTime(properties); + }; + + /** + * Encodes the specified HSMDateTime message. Does not implicitly {@link proto.HSMDateTime.verify|verify} messages. + * @function encode + * @memberof proto.HSMDateTime + * @static + * @param {proto.IHSMDateTime} message HSMDateTime message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HSMDateTime.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.component != null && Object.hasOwnProperty.call(message, "component")) + $root.proto.HSMDateTimeComponent.encode(message.component, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.unixEpoch != null && Object.hasOwnProperty.call(message, "unixEpoch")) + $root.proto.HSMDateTimeUnixEpoch.encode(message.unixEpoch, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified HSMDateTime message, length delimited. Does not implicitly {@link proto.HSMDateTime.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.HSMDateTime + * @static + * @param {proto.IHSMDateTime} message HSMDateTime message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HSMDateTime.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HSMDateTime message from the specified reader or buffer. + * @function decode + * @memberof proto.HSMDateTime + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.HSMDateTime} HSMDateTime + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HSMDateTime.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.HSMDateTime(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.component = $root.proto.HSMDateTimeComponent.decode(reader, reader.uint32()); + break; + case 2: + message.unixEpoch = $root.proto.HSMDateTimeUnixEpoch.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HSMDateTime message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.HSMDateTime + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.HSMDateTime} HSMDateTime + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HSMDateTime.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HSMDateTime message. + * @function verify + * @memberof proto.HSMDateTime + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HSMDateTime.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.component != null && message.hasOwnProperty("component")) { + properties.datetimeOneof = 1; + { + var error = $root.proto.HSMDateTimeComponent.verify(message.component); + if (error) + return "component." + error; + } + } + if (message.unixEpoch != null && message.hasOwnProperty("unixEpoch")) { + if (properties.datetimeOneof === 1) + return "datetimeOneof: multiple values"; + properties.datetimeOneof = 1; + { + var error = $root.proto.HSMDateTimeUnixEpoch.verify(message.unixEpoch); + if (error) + return "unixEpoch." + error; + } + } + return null; + }; + + /** + * Creates a HSMDateTime message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.HSMDateTime + * @static + * @param {Object.} object Plain object + * @returns {proto.HSMDateTime} HSMDateTime + */ + HSMDateTime.fromObject = function fromObject(object) { + if (object instanceof $root.proto.HSMDateTime) + return object; + var message = new $root.proto.HSMDateTime(); + if (object.component != null) { + if (typeof object.component !== "object") + throw TypeError(".proto.HSMDateTime.component: object expected"); + message.component = $root.proto.HSMDateTimeComponent.fromObject(object.component); + } + if (object.unixEpoch != null) { + if (typeof object.unixEpoch !== "object") + throw TypeError(".proto.HSMDateTime.unixEpoch: object expected"); + message.unixEpoch = $root.proto.HSMDateTimeUnixEpoch.fromObject(object.unixEpoch); + } + return message; + }; + + /** + * Creates a plain object from a HSMDateTime message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.HSMDateTime + * @static + * @param {proto.HSMDateTime} message HSMDateTime + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HSMDateTime.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.component != null && message.hasOwnProperty("component")) { + object.component = $root.proto.HSMDateTimeComponent.toObject(message.component, options); + if (options.oneofs) + object.datetimeOneof = "component"; + } + if (message.unixEpoch != null && message.hasOwnProperty("unixEpoch")) { + object.unixEpoch = $root.proto.HSMDateTimeUnixEpoch.toObject(message.unixEpoch, options); + if (options.oneofs) + object.datetimeOneof = "unixEpoch"; + } + return object; + }; + + /** + * Converts this HSMDateTime to JSON. + * @function toJSON + * @memberof proto.HSMDateTime + * @instance + * @returns {Object.} JSON object + */ + HSMDateTime.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return HSMDateTime; + })(); + + proto.HSMLocalizableParameter = (function() { + + /** + * Properties of a HSMLocalizableParameter. + * @memberof proto + * @interface IHSMLocalizableParameter + * @property {string|null} ["default"] HSMLocalizableParameter default + * @property {proto.IHSMCurrency|null} [currency] HSMLocalizableParameter currency + * @property {proto.IHSMDateTime|null} [dateTime] HSMLocalizableParameter dateTime + */ + + /** + * Constructs a new HSMLocalizableParameter. + * @memberof proto + * @classdesc Represents a HSMLocalizableParameter. + * @implements IHSMLocalizableParameter + * @constructor + * @param {proto.IHSMLocalizableParameter=} [properties] Properties to set + */ + function HSMLocalizableParameter(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HSMLocalizableParameter default. + * @member {string} default + * @memberof proto.HSMLocalizableParameter + * @instance + */ + HSMLocalizableParameter.prototype["default"] = ""; + + /** + * HSMLocalizableParameter currency. + * @member {proto.IHSMCurrency|null|undefined} currency + * @memberof proto.HSMLocalizableParameter + * @instance + */ + HSMLocalizableParameter.prototype.currency = null; + + /** + * HSMLocalizableParameter dateTime. + * @member {proto.IHSMDateTime|null|undefined} dateTime + * @memberof proto.HSMLocalizableParameter + * @instance + */ + HSMLocalizableParameter.prototype.dateTime = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HSMLocalizableParameter paramOneof. + * @member {"currency"|"dateTime"|undefined} paramOneof + * @memberof proto.HSMLocalizableParameter + * @instance + */ + Object.defineProperty(HSMLocalizableParameter.prototype, "paramOneof", { + get: $util.oneOfGetter($oneOfFields = ["currency", "dateTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HSMLocalizableParameter instance using the specified properties. + * @function create + * @memberof proto.HSMLocalizableParameter + * @static + * @param {proto.IHSMLocalizableParameter=} [properties] Properties to set + * @returns {proto.HSMLocalizableParameter} HSMLocalizableParameter instance + */ + HSMLocalizableParameter.create = function create(properties) { + return new HSMLocalizableParameter(properties); + }; + + /** + * Encodes the specified HSMLocalizableParameter message. Does not implicitly {@link proto.HSMLocalizableParameter.verify|verify} messages. + * @function encode + * @memberof proto.HSMLocalizableParameter + * @static + * @param {proto.IHSMLocalizableParameter} message HSMLocalizableParameter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HSMLocalizableParameter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message["default"] != null && Object.hasOwnProperty.call(message, "default")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message["default"]); + if (message.currency != null && Object.hasOwnProperty.call(message, "currency")) + $root.proto.HSMCurrency.encode(message.currency, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.dateTime != null && Object.hasOwnProperty.call(message, "dateTime")) + $root.proto.HSMDateTime.encode(message.dateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified HSMLocalizableParameter message, length delimited. Does not implicitly {@link proto.HSMLocalizableParameter.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.HSMLocalizableParameter + * @static + * @param {proto.IHSMLocalizableParameter} message HSMLocalizableParameter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HSMLocalizableParameter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HSMLocalizableParameter message from the specified reader or buffer. + * @function decode + * @memberof proto.HSMLocalizableParameter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.HSMLocalizableParameter} HSMLocalizableParameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HSMLocalizableParameter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.HSMLocalizableParameter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message["default"] = reader.string(); + break; + case 2: + message.currency = $root.proto.HSMCurrency.decode(reader, reader.uint32()); + break; + case 3: + message.dateTime = $root.proto.HSMDateTime.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HSMLocalizableParameter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.HSMLocalizableParameter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.HSMLocalizableParameter} HSMLocalizableParameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HSMLocalizableParameter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HSMLocalizableParameter message. + * @function verify + * @memberof proto.HSMLocalizableParameter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HSMLocalizableParameter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message["default"] != null && message.hasOwnProperty("default")) + if (!$util.isString(message["default"])) + return "default: string expected"; + if (message.currency != null && message.hasOwnProperty("currency")) { + properties.paramOneof = 1; + { + var error = $root.proto.HSMCurrency.verify(message.currency); + if (error) + return "currency." + error; + } + } + if (message.dateTime != null && message.hasOwnProperty("dateTime")) { + if (properties.paramOneof === 1) + return "paramOneof: multiple values"; + properties.paramOneof = 1; + { + var error = $root.proto.HSMDateTime.verify(message.dateTime); + if (error) + return "dateTime." + error; + } + } + return null; + }; + + /** + * Creates a HSMLocalizableParameter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.HSMLocalizableParameter + * @static + * @param {Object.} object Plain object + * @returns {proto.HSMLocalizableParameter} HSMLocalizableParameter + */ + HSMLocalizableParameter.fromObject = function fromObject(object) { + if (object instanceof $root.proto.HSMLocalizableParameter) + return object; + var message = new $root.proto.HSMLocalizableParameter(); + if (object["default"] != null) + message["default"] = String(object["default"]); + if (object.currency != null) { + if (typeof object.currency !== "object") + throw TypeError(".proto.HSMLocalizableParameter.currency: object expected"); + message.currency = $root.proto.HSMCurrency.fromObject(object.currency); + } + if (object.dateTime != null) { + if (typeof object.dateTime !== "object") + throw TypeError(".proto.HSMLocalizableParameter.dateTime: object expected"); + message.dateTime = $root.proto.HSMDateTime.fromObject(object.dateTime); + } + return message; + }; + + /** + * Creates a plain object from a HSMLocalizableParameter message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.HSMLocalizableParameter + * @static + * @param {proto.HSMLocalizableParameter} message HSMLocalizableParameter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HSMLocalizableParameter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object["default"] = ""; + if (message["default"] != null && message.hasOwnProperty("default")) + object["default"] = message["default"]; + if (message.currency != null && message.hasOwnProperty("currency")) { + object.currency = $root.proto.HSMCurrency.toObject(message.currency, options); + if (options.oneofs) + object.paramOneof = "currency"; + } + if (message.dateTime != null && message.hasOwnProperty("dateTime")) { + object.dateTime = $root.proto.HSMDateTime.toObject(message.dateTime, options); + if (options.oneofs) + object.paramOneof = "dateTime"; + } + return object; + }; + + /** + * Converts this HSMLocalizableParameter to JSON. + * @function toJSON + * @memberof proto.HSMLocalizableParameter + * @instance + * @returns {Object.} JSON object + */ + HSMLocalizableParameter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return HSMLocalizableParameter; + })(); + + proto.HighlyStructuredMessage = (function() { + + /** + * Properties of a HighlyStructuredMessage. + * @memberof proto + * @interface IHighlyStructuredMessage + * @property {string|null} [namespace] HighlyStructuredMessage namespace + * @property {string|null} [elementName] HighlyStructuredMessage elementName + * @property {Array.|null} [params] HighlyStructuredMessage params + * @property {string|null} [fallbackLg] HighlyStructuredMessage fallbackLg + * @property {string|null} [fallbackLc] HighlyStructuredMessage fallbackLc + * @property {Array.|null} [localizableParams] HighlyStructuredMessage localizableParams + * @property {string|null} [deterministicLg] HighlyStructuredMessage deterministicLg + * @property {string|null} [deterministicLc] HighlyStructuredMessage deterministicLc + * @property {proto.ITemplateMessage|null} [hydratedHsm] HighlyStructuredMessage hydratedHsm + */ + + /** + * Constructs a new HighlyStructuredMessage. + * @memberof proto + * @classdesc Represents a HighlyStructuredMessage. + * @implements IHighlyStructuredMessage + * @constructor + * @param {proto.IHighlyStructuredMessage=} [properties] Properties to set + */ + function HighlyStructuredMessage(properties) { + this.params = []; + this.localizableParams = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HighlyStructuredMessage namespace. + * @member {string} namespace + * @memberof proto.HighlyStructuredMessage + * @instance + */ + HighlyStructuredMessage.prototype.namespace = ""; + + /** + * HighlyStructuredMessage elementName. + * @member {string} elementName + * @memberof proto.HighlyStructuredMessage + * @instance + */ + HighlyStructuredMessage.prototype.elementName = ""; + + /** + * HighlyStructuredMessage params. + * @member {Array.} params + * @memberof proto.HighlyStructuredMessage + * @instance + */ + HighlyStructuredMessage.prototype.params = $util.emptyArray; + + /** + * HighlyStructuredMessage fallbackLg. + * @member {string} fallbackLg + * @memberof proto.HighlyStructuredMessage + * @instance + */ + HighlyStructuredMessage.prototype.fallbackLg = ""; + + /** + * HighlyStructuredMessage fallbackLc. + * @member {string} fallbackLc + * @memberof proto.HighlyStructuredMessage + * @instance + */ + HighlyStructuredMessage.prototype.fallbackLc = ""; + + /** + * HighlyStructuredMessage localizableParams. + * @member {Array.} localizableParams + * @memberof proto.HighlyStructuredMessage + * @instance + */ + HighlyStructuredMessage.prototype.localizableParams = $util.emptyArray; + + /** + * HighlyStructuredMessage deterministicLg. + * @member {string} deterministicLg + * @memberof proto.HighlyStructuredMessage + * @instance + */ + HighlyStructuredMessage.prototype.deterministicLg = ""; + + /** + * HighlyStructuredMessage deterministicLc. + * @member {string} deterministicLc + * @memberof proto.HighlyStructuredMessage + * @instance + */ + HighlyStructuredMessage.prototype.deterministicLc = ""; + + /** + * HighlyStructuredMessage hydratedHsm. + * @member {proto.ITemplateMessage|null|undefined} hydratedHsm + * @memberof proto.HighlyStructuredMessage + * @instance + */ + HighlyStructuredMessage.prototype.hydratedHsm = null; + + /** + * Creates a new HighlyStructuredMessage instance using the specified properties. + * @function create + * @memberof proto.HighlyStructuredMessage + * @static + * @param {proto.IHighlyStructuredMessage=} [properties] Properties to set + * @returns {proto.HighlyStructuredMessage} HighlyStructuredMessage instance + */ + HighlyStructuredMessage.create = function create(properties) { + return new HighlyStructuredMessage(properties); + }; + + /** + * Encodes the specified HighlyStructuredMessage message. Does not implicitly {@link proto.HighlyStructuredMessage.verify|verify} messages. + * @function encode + * @memberof proto.HighlyStructuredMessage + * @static + * @param {proto.IHighlyStructuredMessage} message HighlyStructuredMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HighlyStructuredMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.namespace != null && Object.hasOwnProperty.call(message, "namespace")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namespace); + if (message.elementName != null && Object.hasOwnProperty.call(message, "elementName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.elementName); + if (message.params != null && message.params.length) + for (var i = 0; i < message.params.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.params[i]); + if (message.fallbackLg != null && Object.hasOwnProperty.call(message, "fallbackLg")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.fallbackLg); + if (message.fallbackLc != null && Object.hasOwnProperty.call(message, "fallbackLc")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.fallbackLc); + if (message.localizableParams != null && message.localizableParams.length) + for (var i = 0; i < message.localizableParams.length; ++i) + $root.proto.HSMLocalizableParameter.encode(message.localizableParams[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.deterministicLg != null && Object.hasOwnProperty.call(message, "deterministicLg")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.deterministicLg); + if (message.deterministicLc != null && Object.hasOwnProperty.call(message, "deterministicLc")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.deterministicLc); + if (message.hydratedHsm != null && Object.hasOwnProperty.call(message, "hydratedHsm")) + $root.proto.TemplateMessage.encode(message.hydratedHsm, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified HighlyStructuredMessage message, length delimited. Does not implicitly {@link proto.HighlyStructuredMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.HighlyStructuredMessage + * @static + * @param {proto.IHighlyStructuredMessage} message HighlyStructuredMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HighlyStructuredMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HighlyStructuredMessage message from the specified reader or buffer. + * @function decode + * @memberof proto.HighlyStructuredMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.HighlyStructuredMessage} HighlyStructuredMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HighlyStructuredMessage.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.HighlyStructuredMessage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.namespace = reader.string(); + break; + case 2: + message.elementName = reader.string(); + break; + case 3: + if (!(message.params && message.params.length)) + message.params = []; + message.params.push(reader.string()); + break; + case 4: + message.fallbackLg = reader.string(); + break; + case 5: + message.fallbackLc = reader.string(); + break; + case 6: + if (!(message.localizableParams && message.localizableParams.length)) + message.localizableParams = []; + message.localizableParams.push($root.proto.HSMLocalizableParameter.decode(reader, reader.uint32())); + break; + case 7: + message.deterministicLg = reader.string(); + break; + case 8: + message.deterministicLc = reader.string(); + break; + case 9: + message.hydratedHsm = $root.proto.TemplateMessage.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HighlyStructuredMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.HighlyStructuredMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.HighlyStructuredMessage} HighlyStructuredMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HighlyStructuredMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HighlyStructuredMessage message. + * @function verify + * @memberof proto.HighlyStructuredMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HighlyStructuredMessage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.namespace != null && message.hasOwnProperty("namespace")) + if (!$util.isString(message.namespace)) + return "namespace: string expected"; + if (message.elementName != null && message.hasOwnProperty("elementName")) + if (!$util.isString(message.elementName)) + return "elementName: string expected"; + if (message.params != null && message.hasOwnProperty("params")) { + if (!Array.isArray(message.params)) + return "params: array expected"; + for (var i = 0; i < message.params.length; ++i) + if (!$util.isString(message.params[i])) + return "params: string[] expected"; + } + if (message.fallbackLg != null && message.hasOwnProperty("fallbackLg")) + if (!$util.isString(message.fallbackLg)) + return "fallbackLg: string expected"; + if (message.fallbackLc != null && message.hasOwnProperty("fallbackLc")) + if (!$util.isString(message.fallbackLc)) + return "fallbackLc: string expected"; + if (message.localizableParams != null && message.hasOwnProperty("localizableParams")) { + if (!Array.isArray(message.localizableParams)) + return "localizableParams: array expected"; + for (var i = 0; i < message.localizableParams.length; ++i) { + var error = $root.proto.HSMLocalizableParameter.verify(message.localizableParams[i]); + if (error) + return "localizableParams." + error; + } + } + if (message.deterministicLg != null && message.hasOwnProperty("deterministicLg")) + if (!$util.isString(message.deterministicLg)) + return "deterministicLg: string expected"; + if (message.deterministicLc != null && message.hasOwnProperty("deterministicLc")) + if (!$util.isString(message.deterministicLc)) + return "deterministicLc: string expected"; + if (message.hydratedHsm != null && message.hasOwnProperty("hydratedHsm")) { + var error = $root.proto.TemplateMessage.verify(message.hydratedHsm); + if (error) + return "hydratedHsm." + error; + } + return null; + }; + + /** + * Creates a HighlyStructuredMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.HighlyStructuredMessage + * @static + * @param {Object.} object Plain object + * @returns {proto.HighlyStructuredMessage} HighlyStructuredMessage + */ + HighlyStructuredMessage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.HighlyStructuredMessage) + return object; + var message = new $root.proto.HighlyStructuredMessage(); + if (object.namespace != null) + message.namespace = String(object.namespace); + if (object.elementName != null) + message.elementName = String(object.elementName); + if (object.params) { + if (!Array.isArray(object.params)) + throw TypeError(".proto.HighlyStructuredMessage.params: array expected"); + message.params = []; + for (var i = 0; i < object.params.length; ++i) + message.params[i] = String(object.params[i]); + } + if (object.fallbackLg != null) + message.fallbackLg = String(object.fallbackLg); + if (object.fallbackLc != null) + message.fallbackLc = String(object.fallbackLc); + if (object.localizableParams) { + if (!Array.isArray(object.localizableParams)) + throw TypeError(".proto.HighlyStructuredMessage.localizableParams: array expected"); + message.localizableParams = []; + for (var i = 0; i < object.localizableParams.length; ++i) { + if (typeof object.localizableParams[i] !== "object") + throw TypeError(".proto.HighlyStructuredMessage.localizableParams: object expected"); + message.localizableParams[i] = $root.proto.HSMLocalizableParameter.fromObject(object.localizableParams[i]); + } + } + if (object.deterministicLg != null) + message.deterministicLg = String(object.deterministicLg); + if (object.deterministicLc != null) + message.deterministicLc = String(object.deterministicLc); + if (object.hydratedHsm != null) { + if (typeof object.hydratedHsm !== "object") + throw TypeError(".proto.HighlyStructuredMessage.hydratedHsm: object expected"); + message.hydratedHsm = $root.proto.TemplateMessage.fromObject(object.hydratedHsm); + } + return message; + }; + + /** + * Creates a plain object from a HighlyStructuredMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.HighlyStructuredMessage + * @static + * @param {proto.HighlyStructuredMessage} message HighlyStructuredMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HighlyStructuredMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.params = []; + object.localizableParams = []; + } + if (options.defaults) { + object.namespace = ""; + object.elementName = ""; + object.fallbackLg = ""; + object.fallbackLc = ""; + object.deterministicLg = ""; + object.deterministicLc = ""; + object.hydratedHsm = null; + } + if (message.namespace != null && message.hasOwnProperty("namespace")) + object.namespace = message.namespace; + if (message.elementName != null && message.hasOwnProperty("elementName")) + object.elementName = message.elementName; + if (message.params && message.params.length) { + object.params = []; + for (var j = 0; j < message.params.length; ++j) + object.params[j] = message.params[j]; + } + if (message.fallbackLg != null && message.hasOwnProperty("fallbackLg")) + object.fallbackLg = message.fallbackLg; + if (message.fallbackLc != null && message.hasOwnProperty("fallbackLc")) + object.fallbackLc = message.fallbackLc; + if (message.localizableParams && message.localizableParams.length) { + object.localizableParams = []; + for (var j = 0; j < message.localizableParams.length; ++j) + object.localizableParams[j] = $root.proto.HSMLocalizableParameter.toObject(message.localizableParams[j], options); + } + if (message.deterministicLg != null && message.hasOwnProperty("deterministicLg")) + object.deterministicLg = message.deterministicLg; + if (message.deterministicLc != null && message.hasOwnProperty("deterministicLc")) + object.deterministicLc = message.deterministicLc; + if (message.hydratedHsm != null && message.hasOwnProperty("hydratedHsm")) + object.hydratedHsm = $root.proto.TemplateMessage.toObject(message.hydratedHsm, options); + return object; + }; + + /** + * Converts this HighlyStructuredMessage to JSON. + * @function toJSON + * @memberof proto.HighlyStructuredMessage + * @instance + * @returns {Object.} JSON object + */ + HighlyStructuredMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return HighlyStructuredMessage; + })(); + + proto.SendPaymentMessage = (function() { + + /** + * Properties of a SendPaymentMessage. + * @memberof proto + * @interface ISendPaymentMessage + * @property {proto.IMessage|null} [noteMessage] SendPaymentMessage noteMessage + * @property {proto.IMessageKey|null} [requestMessageKey] SendPaymentMessage requestMessageKey + */ + + /** + * Constructs a new SendPaymentMessage. + * @memberof proto + * @classdesc Represents a SendPaymentMessage. + * @implements ISendPaymentMessage + * @constructor + * @param {proto.ISendPaymentMessage=} [properties] Properties to set + */ + function SendPaymentMessage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SendPaymentMessage noteMessage. + * @member {proto.IMessage|null|undefined} noteMessage + * @memberof proto.SendPaymentMessage + * @instance + */ + SendPaymentMessage.prototype.noteMessage = null; + + /** + * SendPaymentMessage requestMessageKey. + * @member {proto.IMessageKey|null|undefined} requestMessageKey + * @memberof proto.SendPaymentMessage + * @instance + */ + SendPaymentMessage.prototype.requestMessageKey = null; + + /** + * Creates a new SendPaymentMessage instance using the specified properties. + * @function create + * @memberof proto.SendPaymentMessage + * @static + * @param {proto.ISendPaymentMessage=} [properties] Properties to set + * @returns {proto.SendPaymentMessage} SendPaymentMessage instance + */ + SendPaymentMessage.create = function create(properties) { + return new SendPaymentMessage(properties); + }; + + /** + * Encodes the specified SendPaymentMessage message. Does not implicitly {@link proto.SendPaymentMessage.verify|verify} messages. + * @function encode + * @memberof proto.SendPaymentMessage + * @static + * @param {proto.ISendPaymentMessage} message SendPaymentMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SendPaymentMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.noteMessage != null && Object.hasOwnProperty.call(message, "noteMessage")) + $root.proto.Message.encode(message.noteMessage, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestMessageKey != null && Object.hasOwnProperty.call(message, "requestMessageKey")) + $root.proto.MessageKey.encode(message.requestMessageKey, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SendPaymentMessage message, length delimited. Does not implicitly {@link proto.SendPaymentMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.SendPaymentMessage + * @static + * @param {proto.ISendPaymentMessage} message SendPaymentMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SendPaymentMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SendPaymentMessage message from the specified reader or buffer. + * @function decode + * @memberof proto.SendPaymentMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.SendPaymentMessage} SendPaymentMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SendPaymentMessage.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.SendPaymentMessage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.noteMessage = $root.proto.Message.decode(reader, reader.uint32()); + break; + case 3: + message.requestMessageKey = $root.proto.MessageKey.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SendPaymentMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.SendPaymentMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.SendPaymentMessage} SendPaymentMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SendPaymentMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SendPaymentMessage message. + * @function verify + * @memberof proto.SendPaymentMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SendPaymentMessage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.noteMessage != null && message.hasOwnProperty("noteMessage")) { + var error = $root.proto.Message.verify(message.noteMessage); + if (error) + return "noteMessage." + error; + } + if (message.requestMessageKey != null && message.hasOwnProperty("requestMessageKey")) { + var error = $root.proto.MessageKey.verify(message.requestMessageKey); + if (error) + return "requestMessageKey." + error; + } + return null; + }; + + /** + * Creates a SendPaymentMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.SendPaymentMessage + * @static + * @param {Object.} object Plain object + * @returns {proto.SendPaymentMessage} SendPaymentMessage + */ + SendPaymentMessage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.SendPaymentMessage) + return object; + var message = new $root.proto.SendPaymentMessage(); + if (object.noteMessage != null) { + if (typeof object.noteMessage !== "object") + throw TypeError(".proto.SendPaymentMessage.noteMessage: object expected"); + message.noteMessage = $root.proto.Message.fromObject(object.noteMessage); + } + if (object.requestMessageKey != null) { + if (typeof object.requestMessageKey !== "object") + throw TypeError(".proto.SendPaymentMessage.requestMessageKey: object expected"); + message.requestMessageKey = $root.proto.MessageKey.fromObject(object.requestMessageKey); + } + return message; + }; + + /** + * Creates a plain object from a SendPaymentMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.SendPaymentMessage + * @static + * @param {proto.SendPaymentMessage} message SendPaymentMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SendPaymentMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.noteMessage = null; + object.requestMessageKey = null; + } + if (message.noteMessage != null && message.hasOwnProperty("noteMessage")) + object.noteMessage = $root.proto.Message.toObject(message.noteMessage, options); + if (message.requestMessageKey != null && message.hasOwnProperty("requestMessageKey")) + object.requestMessageKey = $root.proto.MessageKey.toObject(message.requestMessageKey, options); + return object; + }; + + /** + * Converts this SendPaymentMessage to JSON. + * @function toJSON + * @memberof proto.SendPaymentMessage + * @instance + * @returns {Object.} JSON object + */ + SendPaymentMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SendPaymentMessage; + })(); + + proto.RequestPaymentMessage = (function() { + + /** + * Properties of a RequestPaymentMessage. + * @memberof proto + * @interface IRequestPaymentMessage + * @property {proto.IMessage|null} [noteMessage] RequestPaymentMessage noteMessage + * @property {string|null} [currencyCodeIso4217] RequestPaymentMessage currencyCodeIso4217 + * @property {number|Long|null} [amount1000] RequestPaymentMessage amount1000 + * @property {string|null} [requestFrom] RequestPaymentMessage requestFrom + * @property {number|Long|null} [expiryTimestamp] RequestPaymentMessage expiryTimestamp + */ + + /** + * Constructs a new RequestPaymentMessage. + * @memberof proto + * @classdesc Represents a RequestPaymentMessage. + * @implements IRequestPaymentMessage + * @constructor + * @param {proto.IRequestPaymentMessage=} [properties] Properties to set + */ + function RequestPaymentMessage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RequestPaymentMessage noteMessage. + * @member {proto.IMessage|null|undefined} noteMessage + * @memberof proto.RequestPaymentMessage + * @instance + */ + RequestPaymentMessage.prototype.noteMessage = null; + + /** + * RequestPaymentMessage currencyCodeIso4217. + * @member {string} currencyCodeIso4217 + * @memberof proto.RequestPaymentMessage + * @instance + */ + RequestPaymentMessage.prototype.currencyCodeIso4217 = ""; + + /** + * RequestPaymentMessage amount1000. + * @member {number|Long} amount1000 + * @memberof proto.RequestPaymentMessage + * @instance + */ + RequestPaymentMessage.prototype.amount1000 = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * RequestPaymentMessage requestFrom. + * @member {string} requestFrom + * @memberof proto.RequestPaymentMessage + * @instance + */ + RequestPaymentMessage.prototype.requestFrom = ""; + + /** + * RequestPaymentMessage expiryTimestamp. + * @member {number|Long} expiryTimestamp + * @memberof proto.RequestPaymentMessage + * @instance + */ + RequestPaymentMessage.prototype.expiryTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new RequestPaymentMessage instance using the specified properties. + * @function create + * @memberof proto.RequestPaymentMessage + * @static + * @param {proto.IRequestPaymentMessage=} [properties] Properties to set + * @returns {proto.RequestPaymentMessage} RequestPaymentMessage instance + */ + RequestPaymentMessage.create = function create(properties) { + return new RequestPaymentMessage(properties); + }; + + /** + * Encodes the specified RequestPaymentMessage message. Does not implicitly {@link proto.RequestPaymentMessage.verify|verify} messages. + * @function encode + * @memberof proto.RequestPaymentMessage + * @static + * @param {proto.IRequestPaymentMessage} message RequestPaymentMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestPaymentMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.currencyCodeIso4217 != null && Object.hasOwnProperty.call(message, "currencyCodeIso4217")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.currencyCodeIso4217); + if (message.amount1000 != null && Object.hasOwnProperty.call(message, "amount1000")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.amount1000); + if (message.requestFrom != null && Object.hasOwnProperty.call(message, "requestFrom")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestFrom); + if (message.noteMessage != null && Object.hasOwnProperty.call(message, "noteMessage")) + $root.proto.Message.encode(message.noteMessage, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.expiryTimestamp != null && Object.hasOwnProperty.call(message, "expiryTimestamp")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.expiryTimestamp); + return writer; + }; + + /** + * Encodes the specified RequestPaymentMessage message, length delimited. Does not implicitly {@link proto.RequestPaymentMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.RequestPaymentMessage + * @static + * @param {proto.IRequestPaymentMessage} message RequestPaymentMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestPaymentMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RequestPaymentMessage message from the specified reader or buffer. + * @function decode + * @memberof proto.RequestPaymentMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.RequestPaymentMessage} RequestPaymentMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestPaymentMessage.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.RequestPaymentMessage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: + message.noteMessage = $root.proto.Message.decode(reader, reader.uint32()); + break; + case 1: + message.currencyCodeIso4217 = reader.string(); + break; + case 2: + message.amount1000 = reader.uint64(); + break; + case 3: + message.requestFrom = reader.string(); + break; + case 5: + message.expiryTimestamp = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RequestPaymentMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.RequestPaymentMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.RequestPaymentMessage} RequestPaymentMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestPaymentMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RequestPaymentMessage message. + * @function verify + * @memberof proto.RequestPaymentMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RequestPaymentMessage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.noteMessage != null && message.hasOwnProperty("noteMessage")) { + var error = $root.proto.Message.verify(message.noteMessage); + if (error) + return "noteMessage." + error; + } + if (message.currencyCodeIso4217 != null && message.hasOwnProperty("currencyCodeIso4217")) + if (!$util.isString(message.currencyCodeIso4217)) + return "currencyCodeIso4217: string expected"; + if (message.amount1000 != null && message.hasOwnProperty("amount1000")) + if (!$util.isInteger(message.amount1000) && !(message.amount1000 && $util.isInteger(message.amount1000.low) && $util.isInteger(message.amount1000.high))) + return "amount1000: integer|Long expected"; + if (message.requestFrom != null && message.hasOwnProperty("requestFrom")) + if (!$util.isString(message.requestFrom)) + return "requestFrom: string expected"; + if (message.expiryTimestamp != null && message.hasOwnProperty("expiryTimestamp")) + if (!$util.isInteger(message.expiryTimestamp) && !(message.expiryTimestamp && $util.isInteger(message.expiryTimestamp.low) && $util.isInteger(message.expiryTimestamp.high))) + return "expiryTimestamp: integer|Long expected"; + return null; + }; + + /** + * Creates a RequestPaymentMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.RequestPaymentMessage + * @static + * @param {Object.} object Plain object + * @returns {proto.RequestPaymentMessage} RequestPaymentMessage + */ + RequestPaymentMessage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.RequestPaymentMessage) + return object; + var message = new $root.proto.RequestPaymentMessage(); + if (object.noteMessage != null) { + if (typeof object.noteMessage !== "object") + throw TypeError(".proto.RequestPaymentMessage.noteMessage: object expected"); + message.noteMessage = $root.proto.Message.fromObject(object.noteMessage); + } + if (object.currencyCodeIso4217 != null) + message.currencyCodeIso4217 = String(object.currencyCodeIso4217); + if (object.amount1000 != null) + if ($util.Long) + (message.amount1000 = $util.Long.fromValue(object.amount1000)).unsigned = true; + else if (typeof object.amount1000 === "string") + message.amount1000 = parseInt(object.amount1000, 10); + else if (typeof object.amount1000 === "number") + message.amount1000 = object.amount1000; + else if (typeof object.amount1000 === "object") + message.amount1000 = new $util.LongBits(object.amount1000.low >>> 0, object.amount1000.high >>> 0).toNumber(true); + if (object.requestFrom != null) + message.requestFrom = String(object.requestFrom); + if (object.expiryTimestamp != null) + if ($util.Long) + (message.expiryTimestamp = $util.Long.fromValue(object.expiryTimestamp)).unsigned = false; + else if (typeof object.expiryTimestamp === "string") + message.expiryTimestamp = parseInt(object.expiryTimestamp, 10); + else if (typeof object.expiryTimestamp === "number") + message.expiryTimestamp = object.expiryTimestamp; + else if (typeof object.expiryTimestamp === "object") + message.expiryTimestamp = new $util.LongBits(object.expiryTimestamp.low >>> 0, object.expiryTimestamp.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a RequestPaymentMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.RequestPaymentMessage + * @static + * @param {proto.RequestPaymentMessage} message RequestPaymentMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RequestPaymentMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.currencyCodeIso4217 = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.amount1000 = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.amount1000 = options.longs === String ? "0" : 0; + object.requestFrom = ""; + object.noteMessage = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.expiryTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.expiryTimestamp = options.longs === String ? "0" : 0; + } + if (message.currencyCodeIso4217 != null && message.hasOwnProperty("currencyCodeIso4217")) + object.currencyCodeIso4217 = message.currencyCodeIso4217; + if (message.amount1000 != null && message.hasOwnProperty("amount1000")) + if (typeof message.amount1000 === "number") + object.amount1000 = options.longs === String ? String(message.amount1000) : message.amount1000; + else + object.amount1000 = options.longs === String ? $util.Long.prototype.toString.call(message.amount1000) : options.longs === Number ? new $util.LongBits(message.amount1000.low >>> 0, message.amount1000.high >>> 0).toNumber(true) : message.amount1000; + if (message.requestFrom != null && message.hasOwnProperty("requestFrom")) + object.requestFrom = message.requestFrom; + if (message.noteMessage != null && message.hasOwnProperty("noteMessage")) + object.noteMessage = $root.proto.Message.toObject(message.noteMessage, options); + if (message.expiryTimestamp != null && message.hasOwnProperty("expiryTimestamp")) + if (typeof message.expiryTimestamp === "number") + object.expiryTimestamp = options.longs === String ? String(message.expiryTimestamp) : message.expiryTimestamp; + else + object.expiryTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.expiryTimestamp) : options.longs === Number ? new $util.LongBits(message.expiryTimestamp.low >>> 0, message.expiryTimestamp.high >>> 0).toNumber() : message.expiryTimestamp; + return object; + }; + + /** + * Converts this RequestPaymentMessage to JSON. + * @function toJSON + * @memberof proto.RequestPaymentMessage + * @instance + * @returns {Object.} JSON object + */ + RequestPaymentMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RequestPaymentMessage; + })(); + + proto.DeclinePaymentRequestMessage = (function() { + + /** + * Properties of a DeclinePaymentRequestMessage. + * @memberof proto + * @interface IDeclinePaymentRequestMessage + * @property {proto.IMessageKey|null} [key] DeclinePaymentRequestMessage key + */ + + /** + * Constructs a new DeclinePaymentRequestMessage. + * @memberof proto + * @classdesc Represents a DeclinePaymentRequestMessage. + * @implements IDeclinePaymentRequestMessage + * @constructor + * @param {proto.IDeclinePaymentRequestMessage=} [properties] Properties to set + */ + function DeclinePaymentRequestMessage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeclinePaymentRequestMessage key. + * @member {proto.IMessageKey|null|undefined} key + * @memberof proto.DeclinePaymentRequestMessage + * @instance + */ + DeclinePaymentRequestMessage.prototype.key = null; + + /** + * Creates a new DeclinePaymentRequestMessage instance using the specified properties. + * @function create + * @memberof proto.DeclinePaymentRequestMessage + * @static + * @param {proto.IDeclinePaymentRequestMessage=} [properties] Properties to set + * @returns {proto.DeclinePaymentRequestMessage} DeclinePaymentRequestMessage instance + */ + DeclinePaymentRequestMessage.create = function create(properties) { + return new DeclinePaymentRequestMessage(properties); + }; + + /** + * Encodes the specified DeclinePaymentRequestMessage message. Does not implicitly {@link proto.DeclinePaymentRequestMessage.verify|verify} messages. + * @function encode + * @memberof proto.DeclinePaymentRequestMessage + * @static + * @param {proto.IDeclinePaymentRequestMessage} message DeclinePaymentRequestMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeclinePaymentRequestMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + $root.proto.MessageKey.encode(message.key, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DeclinePaymentRequestMessage message, length delimited. Does not implicitly {@link proto.DeclinePaymentRequestMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.DeclinePaymentRequestMessage + * @static + * @param {proto.IDeclinePaymentRequestMessage} message DeclinePaymentRequestMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeclinePaymentRequestMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeclinePaymentRequestMessage message from the specified reader or buffer. + * @function decode + * @memberof proto.DeclinePaymentRequestMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.DeclinePaymentRequestMessage} DeclinePaymentRequestMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeclinePaymentRequestMessage.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.DeclinePaymentRequestMessage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = $root.proto.MessageKey.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeclinePaymentRequestMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.DeclinePaymentRequestMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.DeclinePaymentRequestMessage} DeclinePaymentRequestMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeclinePaymentRequestMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeclinePaymentRequestMessage message. + * @function verify + * @memberof proto.DeclinePaymentRequestMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeclinePaymentRequestMessage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) { + var error = $root.proto.MessageKey.verify(message.key); + if (error) + return "key." + error; + } + return null; + }; + + /** + * Creates a DeclinePaymentRequestMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.DeclinePaymentRequestMessage + * @static + * @param {Object.} object Plain object + * @returns {proto.DeclinePaymentRequestMessage} DeclinePaymentRequestMessage + */ + DeclinePaymentRequestMessage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.DeclinePaymentRequestMessage) + return object; + var message = new $root.proto.DeclinePaymentRequestMessage(); + if (object.key != null) { + if (typeof object.key !== "object") + throw TypeError(".proto.DeclinePaymentRequestMessage.key: object expected"); + message.key = $root.proto.MessageKey.fromObject(object.key); + } + return message; + }; + + /** + * Creates a plain object from a DeclinePaymentRequestMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.DeclinePaymentRequestMessage + * @static + * @param {proto.DeclinePaymentRequestMessage} message DeclinePaymentRequestMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeclinePaymentRequestMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.key = null; + if (message.key != null && message.hasOwnProperty("key")) + object.key = $root.proto.MessageKey.toObject(message.key, options); + return object; + }; + + /** + * Converts this DeclinePaymentRequestMessage to JSON. + * @function toJSON + * @memberof proto.DeclinePaymentRequestMessage + * @instance + * @returns {Object.} JSON object + */ + DeclinePaymentRequestMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeclinePaymentRequestMessage; + })(); + + proto.CancelPaymentRequestMessage = (function() { + + /** + * Properties of a CancelPaymentRequestMessage. + * @memberof proto + * @interface ICancelPaymentRequestMessage + * @property {proto.IMessageKey|null} [key] CancelPaymentRequestMessage key + */ + + /** + * Constructs a new CancelPaymentRequestMessage. + * @memberof proto + * @classdesc Represents a CancelPaymentRequestMessage. + * @implements ICancelPaymentRequestMessage + * @constructor + * @param {proto.ICancelPaymentRequestMessage=} [properties] Properties to set + */ + function CancelPaymentRequestMessage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CancelPaymentRequestMessage key. + * @member {proto.IMessageKey|null|undefined} key + * @memberof proto.CancelPaymentRequestMessage + * @instance + */ + CancelPaymentRequestMessage.prototype.key = null; + + /** + * Creates a new CancelPaymentRequestMessage instance using the specified properties. + * @function create + * @memberof proto.CancelPaymentRequestMessage + * @static + * @param {proto.ICancelPaymentRequestMessage=} [properties] Properties to set + * @returns {proto.CancelPaymentRequestMessage} CancelPaymentRequestMessage instance + */ + CancelPaymentRequestMessage.create = function create(properties) { + return new CancelPaymentRequestMessage(properties); + }; + + /** + * Encodes the specified CancelPaymentRequestMessage message. Does not implicitly {@link proto.CancelPaymentRequestMessage.verify|verify} messages. + * @function encode + * @memberof proto.CancelPaymentRequestMessage + * @static + * @param {proto.ICancelPaymentRequestMessage} message CancelPaymentRequestMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelPaymentRequestMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + $root.proto.MessageKey.encode(message.key, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CancelPaymentRequestMessage message, length delimited. Does not implicitly {@link proto.CancelPaymentRequestMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.CancelPaymentRequestMessage + * @static + * @param {proto.ICancelPaymentRequestMessage} message CancelPaymentRequestMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelPaymentRequestMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelPaymentRequestMessage message from the specified reader or buffer. + * @function decode + * @memberof proto.CancelPaymentRequestMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.CancelPaymentRequestMessage} CancelPaymentRequestMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelPaymentRequestMessage.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.CancelPaymentRequestMessage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = $root.proto.MessageKey.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CancelPaymentRequestMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.CancelPaymentRequestMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.CancelPaymentRequestMessage} CancelPaymentRequestMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelPaymentRequestMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelPaymentRequestMessage message. + * @function verify + * @memberof proto.CancelPaymentRequestMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelPaymentRequestMessage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) { + var error = $root.proto.MessageKey.verify(message.key); + if (error) + return "key." + error; + } + return null; + }; + + /** + * Creates a CancelPaymentRequestMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.CancelPaymentRequestMessage + * @static + * @param {Object.} object Plain object + * @returns {proto.CancelPaymentRequestMessage} CancelPaymentRequestMessage + */ + CancelPaymentRequestMessage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.CancelPaymentRequestMessage) + return object; + var message = new $root.proto.CancelPaymentRequestMessage(); + if (object.key != null) { + if (typeof object.key !== "object") + throw TypeError(".proto.CancelPaymentRequestMessage.key: object expected"); + message.key = $root.proto.MessageKey.fromObject(object.key); + } + return message; + }; + + /** + * Creates a plain object from a CancelPaymentRequestMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.CancelPaymentRequestMessage + * @static + * @param {proto.CancelPaymentRequestMessage} message CancelPaymentRequestMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelPaymentRequestMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.key = null; + if (message.key != null && message.hasOwnProperty("key")) + object.key = $root.proto.MessageKey.toObject(message.key, options); + return object; + }; + + /** + * Converts this CancelPaymentRequestMessage to JSON. + * @function toJSON + * @memberof proto.CancelPaymentRequestMessage + * @instance + * @returns {Object.} JSON object + */ + CancelPaymentRequestMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CancelPaymentRequestMessage; + })(); + + proto.LiveLocationMessage = (function() { + + /** + * Properties of a LiveLocationMessage. + * @memberof proto + * @interface ILiveLocationMessage + * @property {number|null} [degreesLatitude] LiveLocationMessage degreesLatitude + * @property {number|null} [degreesLongitude] LiveLocationMessage degreesLongitude + * @property {number|null} [accuracyInMeters] LiveLocationMessage accuracyInMeters + * @property {number|null} [speedInMps] LiveLocationMessage speedInMps + * @property {number|null} [degreesClockwiseFromMagneticNorth] LiveLocationMessage degreesClockwiseFromMagneticNorth + * @property {string|null} [caption] LiveLocationMessage caption + * @property {number|Long|null} [sequenceNumber] LiveLocationMessage sequenceNumber + * @property {number|null} [timeOffset] LiveLocationMessage timeOffset + * @property {Uint8Array|null} [jpegThumbnail] LiveLocationMessage jpegThumbnail + * @property {proto.IContextInfo|null} [contextInfo] LiveLocationMessage contextInfo + */ + + /** + * Constructs a new LiveLocationMessage. + * @memberof proto + * @classdesc Represents a LiveLocationMessage. + * @implements ILiveLocationMessage + * @constructor + * @param {proto.ILiveLocationMessage=} [properties] Properties to set + */ + function LiveLocationMessage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LiveLocationMessage degreesLatitude. + * @member {number} degreesLatitude + * @memberof proto.LiveLocationMessage + * @instance + */ + LiveLocationMessage.prototype.degreesLatitude = 0; + + /** + * LiveLocationMessage degreesLongitude. + * @member {number} degreesLongitude + * @memberof proto.LiveLocationMessage + * @instance + */ + LiveLocationMessage.prototype.degreesLongitude = 0; + + /** + * LiveLocationMessage accuracyInMeters. + * @member {number} accuracyInMeters + * @memberof proto.LiveLocationMessage + * @instance + */ + LiveLocationMessage.prototype.accuracyInMeters = 0; + + /** + * LiveLocationMessage speedInMps. + * @member {number} speedInMps + * @memberof proto.LiveLocationMessage + * @instance + */ + LiveLocationMessage.prototype.speedInMps = 0; + + /** + * LiveLocationMessage degreesClockwiseFromMagneticNorth. + * @member {number} degreesClockwiseFromMagneticNorth + * @memberof proto.LiveLocationMessage + * @instance + */ + LiveLocationMessage.prototype.degreesClockwiseFromMagneticNorth = 0; + + /** + * LiveLocationMessage caption. + * @member {string} caption + * @memberof proto.LiveLocationMessage + * @instance + */ + LiveLocationMessage.prototype.caption = ""; + + /** + * LiveLocationMessage sequenceNumber. + * @member {number|Long} sequenceNumber + * @memberof proto.LiveLocationMessage + * @instance + */ + LiveLocationMessage.prototype.sequenceNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * LiveLocationMessage timeOffset. + * @member {number} timeOffset + * @memberof proto.LiveLocationMessage + * @instance + */ + LiveLocationMessage.prototype.timeOffset = 0; + + /** + * LiveLocationMessage jpegThumbnail. + * @member {Uint8Array} jpegThumbnail + * @memberof proto.LiveLocationMessage + * @instance + */ + LiveLocationMessage.prototype.jpegThumbnail = $util.newBuffer([]); + + /** + * LiveLocationMessage contextInfo. + * @member {proto.IContextInfo|null|undefined} contextInfo + * @memberof proto.LiveLocationMessage + * @instance + */ + LiveLocationMessage.prototype.contextInfo = null; + + /** + * Creates a new LiveLocationMessage instance using the specified properties. + * @function create + * @memberof proto.LiveLocationMessage + * @static + * @param {proto.ILiveLocationMessage=} [properties] Properties to set + * @returns {proto.LiveLocationMessage} LiveLocationMessage instance + */ + LiveLocationMessage.create = function create(properties) { + return new LiveLocationMessage(properties); + }; + + /** + * Encodes the specified LiveLocationMessage message. Does not implicitly {@link proto.LiveLocationMessage.verify|verify} messages. + * @function encode + * @memberof proto.LiveLocationMessage + * @static + * @param {proto.ILiveLocationMessage} message LiveLocationMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LiveLocationMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.degreesLatitude != null && Object.hasOwnProperty.call(message, "degreesLatitude")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.degreesLatitude); + if (message.degreesLongitude != null && Object.hasOwnProperty.call(message, "degreesLongitude")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.degreesLongitude); + if (message.accuracyInMeters != null && Object.hasOwnProperty.call(message, "accuracyInMeters")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.accuracyInMeters); + if (message.speedInMps != null && Object.hasOwnProperty.call(message, "speedInMps")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.speedInMps); + if (message.degreesClockwiseFromMagneticNorth != null && Object.hasOwnProperty.call(message, "degreesClockwiseFromMagneticNorth")) + writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.degreesClockwiseFromMagneticNorth); + if (message.caption != null && Object.hasOwnProperty.call(message, "caption")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.caption); + if (message.sequenceNumber != null && Object.hasOwnProperty.call(message, "sequenceNumber")) + writer.uint32(/* id 7, wireType 0 =*/56).int64(message.sequenceNumber); + if (message.timeOffset != null && Object.hasOwnProperty.call(message, "timeOffset")) + writer.uint32(/* id 8, wireType 0 =*/64).uint32(message.timeOffset); + if (message.jpegThumbnail != null && Object.hasOwnProperty.call(message, "jpegThumbnail")) + writer.uint32(/* id 16, wireType 2 =*/130).bytes(message.jpegThumbnail); + if (message.contextInfo != null && Object.hasOwnProperty.call(message, "contextInfo")) + $root.proto.ContextInfo.encode(message.contextInfo, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LiveLocationMessage message, length delimited. Does not implicitly {@link proto.LiveLocationMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.LiveLocationMessage + * @static + * @param {proto.ILiveLocationMessage} message LiveLocationMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LiveLocationMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LiveLocationMessage message from the specified reader or buffer. + * @function decode + * @memberof proto.LiveLocationMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.LiveLocationMessage} LiveLocationMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LiveLocationMessage.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.LiveLocationMessage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.degreesLatitude = reader.double(); + break; + case 2: + message.degreesLongitude = reader.double(); + break; + case 3: + message.accuracyInMeters = reader.uint32(); + break; + case 4: + message.speedInMps = reader.float(); + break; + case 5: + message.degreesClockwiseFromMagneticNorth = reader.uint32(); + break; + case 6: + message.caption = reader.string(); + break; + case 7: + message.sequenceNumber = reader.int64(); + break; + case 8: + message.timeOffset = reader.uint32(); + break; + case 16: + message.jpegThumbnail = reader.bytes(); + break; + case 17: + message.contextInfo = $root.proto.ContextInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LiveLocationMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.LiveLocationMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.LiveLocationMessage} LiveLocationMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LiveLocationMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LiveLocationMessage message. + * @function verify + * @memberof proto.LiveLocationMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LiveLocationMessage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.degreesLatitude != null && message.hasOwnProperty("degreesLatitude")) + if (typeof message.degreesLatitude !== "number") + return "degreesLatitude: number expected"; + if (message.degreesLongitude != null && message.hasOwnProperty("degreesLongitude")) + if (typeof message.degreesLongitude !== "number") + return "degreesLongitude: number expected"; + if (message.accuracyInMeters != null && message.hasOwnProperty("accuracyInMeters")) + if (!$util.isInteger(message.accuracyInMeters)) + return "accuracyInMeters: integer expected"; + if (message.speedInMps != null && message.hasOwnProperty("speedInMps")) + if (typeof message.speedInMps !== "number") + return "speedInMps: number expected"; + if (message.degreesClockwiseFromMagneticNorth != null && message.hasOwnProperty("degreesClockwiseFromMagneticNorth")) + if (!$util.isInteger(message.degreesClockwiseFromMagneticNorth)) + return "degreesClockwiseFromMagneticNorth: integer expected"; + if (message.caption != null && message.hasOwnProperty("caption")) + if (!$util.isString(message.caption)) + return "caption: string expected"; + if (message.sequenceNumber != null && message.hasOwnProperty("sequenceNumber")) + if (!$util.isInteger(message.sequenceNumber) && !(message.sequenceNumber && $util.isInteger(message.sequenceNumber.low) && $util.isInteger(message.sequenceNumber.high))) + return "sequenceNumber: integer|Long expected"; + if (message.timeOffset != null && message.hasOwnProperty("timeOffset")) + if (!$util.isInteger(message.timeOffset)) + return "timeOffset: integer expected"; + if (message.jpegThumbnail != null && message.hasOwnProperty("jpegThumbnail")) + if (!(message.jpegThumbnail && typeof message.jpegThumbnail.length === "number" || $util.isString(message.jpegThumbnail))) + return "jpegThumbnail: buffer expected"; + if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) { + var error = $root.proto.ContextInfo.verify(message.contextInfo); + if (error) + return "contextInfo." + error; + } + return null; + }; + + /** + * Creates a LiveLocationMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.LiveLocationMessage + * @static + * @param {Object.} object Plain object + * @returns {proto.LiveLocationMessage} LiveLocationMessage + */ + LiveLocationMessage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.LiveLocationMessage) + return object; + var message = new $root.proto.LiveLocationMessage(); + if (object.degreesLatitude != null) + message.degreesLatitude = Number(object.degreesLatitude); + if (object.degreesLongitude != null) + message.degreesLongitude = Number(object.degreesLongitude); + if (object.accuracyInMeters != null) + message.accuracyInMeters = object.accuracyInMeters >>> 0; + if (object.speedInMps != null) + message.speedInMps = Number(object.speedInMps); + if (object.degreesClockwiseFromMagneticNorth != null) + message.degreesClockwiseFromMagneticNorth = object.degreesClockwiseFromMagneticNorth >>> 0; + if (object.caption != null) + message.caption = String(object.caption); + if (object.sequenceNumber != null) + if ($util.Long) + (message.sequenceNumber = $util.Long.fromValue(object.sequenceNumber)).unsigned = false; + else if (typeof object.sequenceNumber === "string") + message.sequenceNumber = parseInt(object.sequenceNumber, 10); + else if (typeof object.sequenceNumber === "number") + message.sequenceNumber = object.sequenceNumber; + else if (typeof object.sequenceNumber === "object") + message.sequenceNumber = new $util.LongBits(object.sequenceNumber.low >>> 0, object.sequenceNumber.high >>> 0).toNumber(); + if (object.timeOffset != null) + message.timeOffset = object.timeOffset >>> 0; + if (object.jpegThumbnail != null) + if (typeof object.jpegThumbnail === "string") + $util.base64.decode(object.jpegThumbnail, message.jpegThumbnail = $util.newBuffer($util.base64.length(object.jpegThumbnail)), 0); + else if (object.jpegThumbnail.length) + message.jpegThumbnail = object.jpegThumbnail; + if (object.contextInfo != null) { + if (typeof object.contextInfo !== "object") + throw TypeError(".proto.LiveLocationMessage.contextInfo: object expected"); + message.contextInfo = $root.proto.ContextInfo.fromObject(object.contextInfo); + } + return message; + }; + + /** + * Creates a plain object from a LiveLocationMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.LiveLocationMessage + * @static + * @param {proto.LiveLocationMessage} message LiveLocationMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LiveLocationMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.degreesLatitude = 0; + object.degreesLongitude = 0; + object.accuracyInMeters = 0; + object.speedInMps = 0; + object.degreesClockwiseFromMagneticNorth = 0; + object.caption = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.sequenceNumber = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.sequenceNumber = options.longs === String ? "0" : 0; + object.timeOffset = 0; + if (options.bytes === String) + object.jpegThumbnail = ""; + else { + object.jpegThumbnail = []; + if (options.bytes !== Array) + object.jpegThumbnail = $util.newBuffer(object.jpegThumbnail); + } + object.contextInfo = null; + } + if (message.degreesLatitude != null && message.hasOwnProperty("degreesLatitude")) + object.degreesLatitude = options.json && !isFinite(message.degreesLatitude) ? String(message.degreesLatitude) : message.degreesLatitude; + if (message.degreesLongitude != null && message.hasOwnProperty("degreesLongitude")) + object.degreesLongitude = options.json && !isFinite(message.degreesLongitude) ? String(message.degreesLongitude) : message.degreesLongitude; + if (message.accuracyInMeters != null && message.hasOwnProperty("accuracyInMeters")) + object.accuracyInMeters = message.accuracyInMeters; + if (message.speedInMps != null && message.hasOwnProperty("speedInMps")) + object.speedInMps = options.json && !isFinite(message.speedInMps) ? String(message.speedInMps) : message.speedInMps; + if (message.degreesClockwiseFromMagneticNorth != null && message.hasOwnProperty("degreesClockwiseFromMagneticNorth")) + object.degreesClockwiseFromMagneticNorth = message.degreesClockwiseFromMagneticNorth; + if (message.caption != null && message.hasOwnProperty("caption")) + object.caption = message.caption; + if (message.sequenceNumber != null && message.hasOwnProperty("sequenceNumber")) + if (typeof message.sequenceNumber === "number") + object.sequenceNumber = options.longs === String ? String(message.sequenceNumber) : message.sequenceNumber; + else + object.sequenceNumber = options.longs === String ? $util.Long.prototype.toString.call(message.sequenceNumber) : options.longs === Number ? new $util.LongBits(message.sequenceNumber.low >>> 0, message.sequenceNumber.high >>> 0).toNumber() : message.sequenceNumber; + if (message.timeOffset != null && message.hasOwnProperty("timeOffset")) + object.timeOffset = message.timeOffset; + if (message.jpegThumbnail != null && message.hasOwnProperty("jpegThumbnail")) + object.jpegThumbnail = options.bytes === String ? $util.base64.encode(message.jpegThumbnail, 0, message.jpegThumbnail.length) : options.bytes === Array ? Array.prototype.slice.call(message.jpegThumbnail) : message.jpegThumbnail; + if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) + object.contextInfo = $root.proto.ContextInfo.toObject(message.contextInfo, options); + return object; + }; + + /** + * Converts this LiveLocationMessage to JSON. + * @function toJSON + * @memberof proto.LiveLocationMessage + * @instance + * @returns {Object.} JSON object + */ + LiveLocationMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return LiveLocationMessage; + })(); + + proto.StickerMessage = (function() { + + /** + * Properties of a StickerMessage. + * @memberof proto + * @interface IStickerMessage + * @property {string|null} [url] StickerMessage url + * @property {Uint8Array|null} [fileSha256] StickerMessage fileSha256 + * @property {Uint8Array|null} [fileEncSha256] StickerMessage fileEncSha256 + * @property {Uint8Array|null} [mediaKey] StickerMessage mediaKey + * @property {string|null} [mimetype] StickerMessage mimetype + * @property {number|null} [height] StickerMessage height + * @property {number|null} [width] StickerMessage width + * @property {string|null} [directPath] StickerMessage directPath + * @property {number|Long|null} [fileLength] StickerMessage fileLength + * @property {number|Long|null} [mediaKeyTimestamp] StickerMessage mediaKeyTimestamp + * @property {number|null} [firstFrameLength] StickerMessage firstFrameLength + * @property {Uint8Array|null} [firstFrameSidecar] StickerMessage firstFrameSidecar + * @property {proto.IContextInfo|null} [contextInfo] StickerMessage contextInfo + */ + + /** + * Constructs a new StickerMessage. + * @memberof proto + * @classdesc Represents a StickerMessage. + * @implements IStickerMessage + * @constructor + * @param {proto.IStickerMessage=} [properties] Properties to set + */ + function StickerMessage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StickerMessage url. + * @member {string} url + * @memberof proto.StickerMessage + * @instance + */ + StickerMessage.prototype.url = ""; + + /** + * StickerMessage fileSha256. + * @member {Uint8Array} fileSha256 + * @memberof proto.StickerMessage + * @instance + */ + StickerMessage.prototype.fileSha256 = $util.newBuffer([]); + + /** + * StickerMessage fileEncSha256. + * @member {Uint8Array} fileEncSha256 + * @memberof proto.StickerMessage + * @instance + */ + StickerMessage.prototype.fileEncSha256 = $util.newBuffer([]); + + /** + * StickerMessage mediaKey. + * @member {Uint8Array} mediaKey + * @memberof proto.StickerMessage + * @instance + */ + StickerMessage.prototype.mediaKey = $util.newBuffer([]); + + /** + * StickerMessage mimetype. + * @member {string} mimetype + * @memberof proto.StickerMessage + * @instance + */ + StickerMessage.prototype.mimetype = ""; + + /** + * StickerMessage height. + * @member {number} height + * @memberof proto.StickerMessage + * @instance + */ + StickerMessage.prototype.height = 0; + + /** + * StickerMessage width. + * @member {number} width + * @memberof proto.StickerMessage + * @instance + */ + StickerMessage.prototype.width = 0; + + /** + * StickerMessage directPath. + * @member {string} directPath + * @memberof proto.StickerMessage + * @instance + */ + StickerMessage.prototype.directPath = ""; + + /** + * StickerMessage fileLength. + * @member {number|Long} fileLength + * @memberof proto.StickerMessage + * @instance + */ + StickerMessage.prototype.fileLength = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * StickerMessage mediaKeyTimestamp. + * @member {number|Long} mediaKeyTimestamp + * @memberof proto.StickerMessage + * @instance + */ + StickerMessage.prototype.mediaKeyTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * StickerMessage firstFrameLength. + * @member {number} firstFrameLength + * @memberof proto.StickerMessage + * @instance + */ + StickerMessage.prototype.firstFrameLength = 0; + + /** + * StickerMessage firstFrameSidecar. + * @member {Uint8Array} firstFrameSidecar + * @memberof proto.StickerMessage + * @instance + */ + StickerMessage.prototype.firstFrameSidecar = $util.newBuffer([]); + + /** + * StickerMessage contextInfo. + * @member {proto.IContextInfo|null|undefined} contextInfo + * @memberof proto.StickerMessage + * @instance + */ + StickerMessage.prototype.contextInfo = null; + + /** + * Creates a new StickerMessage instance using the specified properties. + * @function create + * @memberof proto.StickerMessage + * @static + * @param {proto.IStickerMessage=} [properties] Properties to set + * @returns {proto.StickerMessage} StickerMessage instance + */ + StickerMessage.create = function create(properties) { + return new StickerMessage(properties); + }; + + /** + * Encodes the specified StickerMessage message. Does not implicitly {@link proto.StickerMessage.verify|verify} messages. + * @function encode + * @memberof proto.StickerMessage + * @static + * @param {proto.IStickerMessage} message StickerMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StickerMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.url != null && Object.hasOwnProperty.call(message, "url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.url); + if (message.fileSha256 != null && Object.hasOwnProperty.call(message, "fileSha256")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.fileSha256); + if (message.fileEncSha256 != null && Object.hasOwnProperty.call(message, "fileEncSha256")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.fileEncSha256); + if (message.mediaKey != null && Object.hasOwnProperty.call(message, "mediaKey")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.mediaKey); + if (message.mimetype != null && Object.hasOwnProperty.call(message, "mimetype")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.mimetype); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.height); + if (message.width != null && Object.hasOwnProperty.call(message, "width")) + writer.uint32(/* id 7, wireType 0 =*/56).uint32(message.width); + if (message.directPath != null && Object.hasOwnProperty.call(message, "directPath")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.directPath); + if (message.fileLength != null && Object.hasOwnProperty.call(message, "fileLength")) + writer.uint32(/* id 9, wireType 0 =*/72).uint64(message.fileLength); + if (message.mediaKeyTimestamp != null && Object.hasOwnProperty.call(message, "mediaKeyTimestamp")) + writer.uint32(/* id 10, wireType 0 =*/80).int64(message.mediaKeyTimestamp); + if (message.firstFrameLength != null && Object.hasOwnProperty.call(message, "firstFrameLength")) + writer.uint32(/* id 11, wireType 0 =*/88).uint32(message.firstFrameLength); + if (message.firstFrameSidecar != null && Object.hasOwnProperty.call(message, "firstFrameSidecar")) + writer.uint32(/* id 12, wireType 2 =*/98).bytes(message.firstFrameSidecar); + if (message.contextInfo != null && Object.hasOwnProperty.call(message, "contextInfo")) + $root.proto.ContextInfo.encode(message.contextInfo, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StickerMessage message, length delimited. Does not implicitly {@link proto.StickerMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.StickerMessage + * @static + * @param {proto.IStickerMessage} message StickerMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StickerMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StickerMessage message from the specified reader or buffer. + * @function decode + * @memberof proto.StickerMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.StickerMessage} StickerMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StickerMessage.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.StickerMessage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.url = reader.string(); + break; + case 2: + message.fileSha256 = reader.bytes(); + break; + case 3: + message.fileEncSha256 = reader.bytes(); + break; + case 4: + message.mediaKey = reader.bytes(); + break; + case 5: + message.mimetype = reader.string(); + break; + case 6: + message.height = reader.uint32(); + break; + case 7: + message.width = reader.uint32(); + break; + case 8: + message.directPath = reader.string(); + break; + case 9: + message.fileLength = reader.uint64(); + break; + case 10: + message.mediaKeyTimestamp = reader.int64(); + break; + case 11: + message.firstFrameLength = reader.uint32(); + break; + case 12: + message.firstFrameSidecar = reader.bytes(); + break; + case 17: + message.contextInfo = $root.proto.ContextInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StickerMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.StickerMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.StickerMessage} StickerMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StickerMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StickerMessage message. + * @function verify + * @memberof proto.StickerMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StickerMessage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.url != null && message.hasOwnProperty("url")) + if (!$util.isString(message.url)) + return "url: string expected"; + if (message.fileSha256 != null && message.hasOwnProperty("fileSha256")) + if (!(message.fileSha256 && typeof message.fileSha256.length === "number" || $util.isString(message.fileSha256))) + return "fileSha256: buffer expected"; + if (message.fileEncSha256 != null && message.hasOwnProperty("fileEncSha256")) + if (!(message.fileEncSha256 && typeof message.fileEncSha256.length === "number" || $util.isString(message.fileEncSha256))) + return "fileEncSha256: buffer expected"; + if (message.mediaKey != null && message.hasOwnProperty("mediaKey")) + if (!(message.mediaKey && typeof message.mediaKey.length === "number" || $util.isString(message.mediaKey))) + return "mediaKey: buffer expected"; + if (message.mimetype != null && message.hasOwnProperty("mimetype")) + if (!$util.isString(message.mimetype)) + return "mimetype: string expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height)) + return "height: integer expected"; + if (message.width != null && message.hasOwnProperty("width")) + if (!$util.isInteger(message.width)) + return "width: integer expected"; + if (message.directPath != null && message.hasOwnProperty("directPath")) + if (!$util.isString(message.directPath)) + return "directPath: string expected"; + if (message.fileLength != null && message.hasOwnProperty("fileLength")) + if (!$util.isInteger(message.fileLength) && !(message.fileLength && $util.isInteger(message.fileLength.low) && $util.isInteger(message.fileLength.high))) + return "fileLength: integer|Long expected"; + if (message.mediaKeyTimestamp != null && message.hasOwnProperty("mediaKeyTimestamp")) + if (!$util.isInteger(message.mediaKeyTimestamp) && !(message.mediaKeyTimestamp && $util.isInteger(message.mediaKeyTimestamp.low) && $util.isInteger(message.mediaKeyTimestamp.high))) + return "mediaKeyTimestamp: integer|Long expected"; + if (message.firstFrameLength != null && message.hasOwnProperty("firstFrameLength")) + if (!$util.isInteger(message.firstFrameLength)) + return "firstFrameLength: integer expected"; + if (message.firstFrameSidecar != null && message.hasOwnProperty("firstFrameSidecar")) + if (!(message.firstFrameSidecar && typeof message.firstFrameSidecar.length === "number" || $util.isString(message.firstFrameSidecar))) + return "firstFrameSidecar: buffer expected"; + if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) { + var error = $root.proto.ContextInfo.verify(message.contextInfo); + if (error) + return "contextInfo." + error; + } + return null; + }; + + /** + * Creates a StickerMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.StickerMessage + * @static + * @param {Object.} object Plain object + * @returns {proto.StickerMessage} StickerMessage + */ + StickerMessage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.StickerMessage) + return object; + var message = new $root.proto.StickerMessage(); + if (object.url != null) + message.url = String(object.url); + if (object.fileSha256 != null) + if (typeof object.fileSha256 === "string") + $util.base64.decode(object.fileSha256, message.fileSha256 = $util.newBuffer($util.base64.length(object.fileSha256)), 0); + else if (object.fileSha256.length) + message.fileSha256 = object.fileSha256; + if (object.fileEncSha256 != null) + if (typeof object.fileEncSha256 === "string") + $util.base64.decode(object.fileEncSha256, message.fileEncSha256 = $util.newBuffer($util.base64.length(object.fileEncSha256)), 0); + else if (object.fileEncSha256.length) + message.fileEncSha256 = object.fileEncSha256; + if (object.mediaKey != null) + if (typeof object.mediaKey === "string") + $util.base64.decode(object.mediaKey, message.mediaKey = $util.newBuffer($util.base64.length(object.mediaKey)), 0); + else if (object.mediaKey.length) + message.mediaKey = object.mediaKey; + if (object.mimetype != null) + message.mimetype = String(object.mimetype); + if (object.height != null) + message.height = object.height >>> 0; + if (object.width != null) + message.width = object.width >>> 0; + if (object.directPath != null) + message.directPath = String(object.directPath); + if (object.fileLength != null) + if ($util.Long) + (message.fileLength = $util.Long.fromValue(object.fileLength)).unsigned = true; + else if (typeof object.fileLength === "string") + message.fileLength = parseInt(object.fileLength, 10); + else if (typeof object.fileLength === "number") + message.fileLength = object.fileLength; + else if (typeof object.fileLength === "object") + message.fileLength = new $util.LongBits(object.fileLength.low >>> 0, object.fileLength.high >>> 0).toNumber(true); + if (object.mediaKeyTimestamp != null) + if ($util.Long) + (message.mediaKeyTimestamp = $util.Long.fromValue(object.mediaKeyTimestamp)).unsigned = false; + else if (typeof object.mediaKeyTimestamp === "string") + message.mediaKeyTimestamp = parseInt(object.mediaKeyTimestamp, 10); + else if (typeof object.mediaKeyTimestamp === "number") + message.mediaKeyTimestamp = object.mediaKeyTimestamp; + else if (typeof object.mediaKeyTimestamp === "object") + message.mediaKeyTimestamp = new $util.LongBits(object.mediaKeyTimestamp.low >>> 0, object.mediaKeyTimestamp.high >>> 0).toNumber(); + if (object.firstFrameLength != null) + message.firstFrameLength = object.firstFrameLength >>> 0; + if (object.firstFrameSidecar != null) + if (typeof object.firstFrameSidecar === "string") + $util.base64.decode(object.firstFrameSidecar, message.firstFrameSidecar = $util.newBuffer($util.base64.length(object.firstFrameSidecar)), 0); + else if (object.firstFrameSidecar.length) + message.firstFrameSidecar = object.firstFrameSidecar; + if (object.contextInfo != null) { + if (typeof object.contextInfo !== "object") + throw TypeError(".proto.StickerMessage.contextInfo: object expected"); + message.contextInfo = $root.proto.ContextInfo.fromObject(object.contextInfo); + } + return message; + }; + + /** + * Creates a plain object from a StickerMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.StickerMessage + * @static + * @param {proto.StickerMessage} message StickerMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StickerMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.url = ""; + if (options.bytes === String) + object.fileSha256 = ""; + else { + object.fileSha256 = []; + if (options.bytes !== Array) + object.fileSha256 = $util.newBuffer(object.fileSha256); + } + if (options.bytes === String) + object.fileEncSha256 = ""; + else { + object.fileEncSha256 = []; + if (options.bytes !== Array) + object.fileEncSha256 = $util.newBuffer(object.fileEncSha256); + } + if (options.bytes === String) + object.mediaKey = ""; + else { + object.mediaKey = []; + if (options.bytes !== Array) + object.mediaKey = $util.newBuffer(object.mediaKey); + } + object.mimetype = ""; + object.height = 0; + object.width = 0; + object.directPath = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.fileLength = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.fileLength = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.mediaKeyTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.mediaKeyTimestamp = options.longs === String ? "0" : 0; + object.firstFrameLength = 0; + if (options.bytes === String) + object.firstFrameSidecar = ""; + else { + object.firstFrameSidecar = []; + if (options.bytes !== Array) + object.firstFrameSidecar = $util.newBuffer(object.firstFrameSidecar); + } + object.contextInfo = null; + } + if (message.url != null && message.hasOwnProperty("url")) + object.url = message.url; + if (message.fileSha256 != null && message.hasOwnProperty("fileSha256")) + object.fileSha256 = options.bytes === String ? $util.base64.encode(message.fileSha256, 0, message.fileSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.fileSha256) : message.fileSha256; + if (message.fileEncSha256 != null && message.hasOwnProperty("fileEncSha256")) + object.fileEncSha256 = options.bytes === String ? $util.base64.encode(message.fileEncSha256, 0, message.fileEncSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.fileEncSha256) : message.fileEncSha256; + if (message.mediaKey != null && message.hasOwnProperty("mediaKey")) + object.mediaKey = options.bytes === String ? $util.base64.encode(message.mediaKey, 0, message.mediaKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.mediaKey) : message.mediaKey; + if (message.mimetype != null && message.hasOwnProperty("mimetype")) + object.mimetype = message.mimetype; + if (message.height != null && message.hasOwnProperty("height")) + object.height = message.height; + if (message.width != null && message.hasOwnProperty("width")) + object.width = message.width; + if (message.directPath != null && message.hasOwnProperty("directPath")) + object.directPath = message.directPath; + if (message.fileLength != null && message.hasOwnProperty("fileLength")) + if (typeof message.fileLength === "number") + object.fileLength = options.longs === String ? String(message.fileLength) : message.fileLength; + else + object.fileLength = options.longs === String ? $util.Long.prototype.toString.call(message.fileLength) : options.longs === Number ? new $util.LongBits(message.fileLength.low >>> 0, message.fileLength.high >>> 0).toNumber(true) : message.fileLength; + if (message.mediaKeyTimestamp != null && message.hasOwnProperty("mediaKeyTimestamp")) + if (typeof message.mediaKeyTimestamp === "number") + object.mediaKeyTimestamp = options.longs === String ? String(message.mediaKeyTimestamp) : message.mediaKeyTimestamp; + else + object.mediaKeyTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.mediaKeyTimestamp) : options.longs === Number ? new $util.LongBits(message.mediaKeyTimestamp.low >>> 0, message.mediaKeyTimestamp.high >>> 0).toNumber() : message.mediaKeyTimestamp; + if (message.firstFrameLength != null && message.hasOwnProperty("firstFrameLength")) + object.firstFrameLength = message.firstFrameLength; + if (message.firstFrameSidecar != null && message.hasOwnProperty("firstFrameSidecar")) + object.firstFrameSidecar = options.bytes === String ? $util.base64.encode(message.firstFrameSidecar, 0, message.firstFrameSidecar.length) : options.bytes === Array ? Array.prototype.slice.call(message.firstFrameSidecar) : message.firstFrameSidecar; + if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) + object.contextInfo = $root.proto.ContextInfo.toObject(message.contextInfo, options); + return object; + }; + + /** + * Converts this StickerMessage to JSON. + * @function toJSON + * @memberof proto.StickerMessage + * @instance + * @returns {Object.} JSON object + */ + StickerMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StickerMessage; + })(); + + proto.FourRowTemplate = (function() { + + /** + * Properties of a FourRowTemplate. + * @memberof proto + * @interface IFourRowTemplate + * @property {proto.IHighlyStructuredMessage|null} [content] FourRowTemplate content + * @property {proto.IHighlyStructuredMessage|null} [footer] FourRowTemplate footer + * @property {Array.|null} [buttons] FourRowTemplate buttons + * @property {proto.IDocumentMessage|null} [documentMessage] FourRowTemplate documentMessage + * @property {proto.IHighlyStructuredMessage|null} [highlyStructuredMessage] FourRowTemplate highlyStructuredMessage + * @property {proto.IImageMessage|null} [imageMessage] FourRowTemplate imageMessage + * @property {proto.IVideoMessage|null} [videoMessage] FourRowTemplate videoMessage + * @property {proto.ILocationMessage|null} [locationMessage] FourRowTemplate locationMessage + */ + + /** + * Constructs a new FourRowTemplate. + * @memberof proto + * @classdesc Represents a FourRowTemplate. + * @implements IFourRowTemplate + * @constructor + * @param {proto.IFourRowTemplate=} [properties] Properties to set + */ + function FourRowTemplate(properties) { + this.buttons = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FourRowTemplate content. + * @member {proto.IHighlyStructuredMessage|null|undefined} content + * @memberof proto.FourRowTemplate + * @instance + */ + FourRowTemplate.prototype.content = null; + + /** + * FourRowTemplate footer. + * @member {proto.IHighlyStructuredMessage|null|undefined} footer + * @memberof proto.FourRowTemplate + * @instance + */ + FourRowTemplate.prototype.footer = null; + + /** + * FourRowTemplate buttons. + * @member {Array.} buttons + * @memberof proto.FourRowTemplate + * @instance + */ + FourRowTemplate.prototype.buttons = $util.emptyArray; + + /** + * FourRowTemplate documentMessage. + * @member {proto.IDocumentMessage|null|undefined} documentMessage + * @memberof proto.FourRowTemplate + * @instance + */ + FourRowTemplate.prototype.documentMessage = null; + + /** + * FourRowTemplate highlyStructuredMessage. + * @member {proto.IHighlyStructuredMessage|null|undefined} highlyStructuredMessage + * @memberof proto.FourRowTemplate + * @instance + */ + FourRowTemplate.prototype.highlyStructuredMessage = null; + + /** + * FourRowTemplate imageMessage. + * @member {proto.IImageMessage|null|undefined} imageMessage + * @memberof proto.FourRowTemplate + * @instance + */ + FourRowTemplate.prototype.imageMessage = null; + + /** + * FourRowTemplate videoMessage. + * @member {proto.IVideoMessage|null|undefined} videoMessage + * @memberof proto.FourRowTemplate + * @instance + */ + FourRowTemplate.prototype.videoMessage = null; + + /** + * FourRowTemplate locationMessage. + * @member {proto.ILocationMessage|null|undefined} locationMessage + * @memberof proto.FourRowTemplate + * @instance + */ + FourRowTemplate.prototype.locationMessage = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * FourRowTemplate title. + * @member {"documentMessage"|"highlyStructuredMessage"|"imageMessage"|"videoMessage"|"locationMessage"|undefined} title + * @memberof proto.FourRowTemplate + * @instance + */ + Object.defineProperty(FourRowTemplate.prototype, "title", { + get: $util.oneOfGetter($oneOfFields = ["documentMessage", "highlyStructuredMessage", "imageMessage", "videoMessage", "locationMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new FourRowTemplate instance using the specified properties. + * @function create + * @memberof proto.FourRowTemplate + * @static + * @param {proto.IFourRowTemplate=} [properties] Properties to set + * @returns {proto.FourRowTemplate} FourRowTemplate instance + */ + FourRowTemplate.create = function create(properties) { + return new FourRowTemplate(properties); + }; + + /** + * Encodes the specified FourRowTemplate message. Does not implicitly {@link proto.FourRowTemplate.verify|verify} messages. + * @function encode + * @memberof proto.FourRowTemplate + * @static + * @param {proto.IFourRowTemplate} message FourRowTemplate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FourRowTemplate.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.documentMessage != null && Object.hasOwnProperty.call(message, "documentMessage")) + $root.proto.DocumentMessage.encode(message.documentMessage, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.highlyStructuredMessage != null && Object.hasOwnProperty.call(message, "highlyStructuredMessage")) + $root.proto.HighlyStructuredMessage.encode(message.highlyStructuredMessage, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.imageMessage != null && Object.hasOwnProperty.call(message, "imageMessage")) + $root.proto.ImageMessage.encode(message.imageMessage, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.videoMessage != null && Object.hasOwnProperty.call(message, "videoMessage")) + $root.proto.VideoMessage.encode(message.videoMessage, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.locationMessage != null && Object.hasOwnProperty.call(message, "locationMessage")) + $root.proto.LocationMessage.encode(message.locationMessage, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + $root.proto.HighlyStructuredMessage.encode(message.content, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.footer != null && Object.hasOwnProperty.call(message, "footer")) + $root.proto.HighlyStructuredMessage.encode(message.footer, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.buttons != null && message.buttons.length) + for (var i = 0; i < message.buttons.length; ++i) + $root.proto.TemplateButton.encode(message.buttons[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FourRowTemplate message, length delimited. Does not implicitly {@link proto.FourRowTemplate.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.FourRowTemplate + * @static + * @param {proto.IFourRowTemplate} message FourRowTemplate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FourRowTemplate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FourRowTemplate message from the specified reader or buffer. + * @function decode + * @memberof proto.FourRowTemplate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.FourRowTemplate} FourRowTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FourRowTemplate.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.FourRowTemplate(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 6: + message.content = $root.proto.HighlyStructuredMessage.decode(reader, reader.uint32()); + break; + case 7: + message.footer = $root.proto.HighlyStructuredMessage.decode(reader, reader.uint32()); + break; + case 8: + if (!(message.buttons && message.buttons.length)) + message.buttons = []; + message.buttons.push($root.proto.TemplateButton.decode(reader, reader.uint32())); + break; + case 1: + message.documentMessage = $root.proto.DocumentMessage.decode(reader, reader.uint32()); + break; + case 2: + message.highlyStructuredMessage = $root.proto.HighlyStructuredMessage.decode(reader, reader.uint32()); + break; + case 3: + message.imageMessage = $root.proto.ImageMessage.decode(reader, reader.uint32()); + break; + case 4: + message.videoMessage = $root.proto.VideoMessage.decode(reader, reader.uint32()); + break; + case 5: + message.locationMessage = $root.proto.LocationMessage.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FourRowTemplate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.FourRowTemplate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.FourRowTemplate} FourRowTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FourRowTemplate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FourRowTemplate message. + * @function verify + * @memberof proto.FourRowTemplate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FourRowTemplate.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.content != null && message.hasOwnProperty("content")) { + var error = $root.proto.HighlyStructuredMessage.verify(message.content); + if (error) + return "content." + error; + } + if (message.footer != null && message.hasOwnProperty("footer")) { + var error = $root.proto.HighlyStructuredMessage.verify(message.footer); + if (error) + return "footer." + error; + } + if (message.buttons != null && message.hasOwnProperty("buttons")) { + if (!Array.isArray(message.buttons)) + return "buttons: array expected"; + for (var i = 0; i < message.buttons.length; ++i) { + var error = $root.proto.TemplateButton.verify(message.buttons[i]); + if (error) + return "buttons." + error; + } + } + if (message.documentMessage != null && message.hasOwnProperty("documentMessage")) { + properties.title = 1; + { + var error = $root.proto.DocumentMessage.verify(message.documentMessage); + if (error) + return "documentMessage." + error; + } + } + if (message.highlyStructuredMessage != null && message.hasOwnProperty("highlyStructuredMessage")) { + if (properties.title === 1) + return "title: multiple values"; + properties.title = 1; + { + var error = $root.proto.HighlyStructuredMessage.verify(message.highlyStructuredMessage); + if (error) + return "highlyStructuredMessage." + error; + } + } + if (message.imageMessage != null && message.hasOwnProperty("imageMessage")) { + if (properties.title === 1) + return "title: multiple values"; + properties.title = 1; + { + var error = $root.proto.ImageMessage.verify(message.imageMessage); + if (error) + return "imageMessage." + error; + } + } + if (message.videoMessage != null && message.hasOwnProperty("videoMessage")) { + if (properties.title === 1) + return "title: multiple values"; + properties.title = 1; + { + var error = $root.proto.VideoMessage.verify(message.videoMessage); + if (error) + return "videoMessage." + error; + } + } + if (message.locationMessage != null && message.hasOwnProperty("locationMessage")) { + if (properties.title === 1) + return "title: multiple values"; + properties.title = 1; + { + var error = $root.proto.LocationMessage.verify(message.locationMessage); + if (error) + return "locationMessage." + error; + } + } + return null; + }; + + /** + * Creates a FourRowTemplate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.FourRowTemplate + * @static + * @param {Object.} object Plain object + * @returns {proto.FourRowTemplate} FourRowTemplate + */ + FourRowTemplate.fromObject = function fromObject(object) { + if (object instanceof $root.proto.FourRowTemplate) + return object; + var message = new $root.proto.FourRowTemplate(); + if (object.content != null) { + if (typeof object.content !== "object") + throw TypeError(".proto.FourRowTemplate.content: object expected"); + message.content = $root.proto.HighlyStructuredMessage.fromObject(object.content); + } + if (object.footer != null) { + if (typeof object.footer !== "object") + throw TypeError(".proto.FourRowTemplate.footer: object expected"); + message.footer = $root.proto.HighlyStructuredMessage.fromObject(object.footer); + } + if (object.buttons) { + if (!Array.isArray(object.buttons)) + throw TypeError(".proto.FourRowTemplate.buttons: array expected"); + message.buttons = []; + for (var i = 0; i < object.buttons.length; ++i) { + if (typeof object.buttons[i] !== "object") + throw TypeError(".proto.FourRowTemplate.buttons: object expected"); + message.buttons[i] = $root.proto.TemplateButton.fromObject(object.buttons[i]); + } + } + if (object.documentMessage != null) { + if (typeof object.documentMessage !== "object") + throw TypeError(".proto.FourRowTemplate.documentMessage: object expected"); + message.documentMessage = $root.proto.DocumentMessage.fromObject(object.documentMessage); + } + if (object.highlyStructuredMessage != null) { + if (typeof object.highlyStructuredMessage !== "object") + throw TypeError(".proto.FourRowTemplate.highlyStructuredMessage: object expected"); + message.highlyStructuredMessage = $root.proto.HighlyStructuredMessage.fromObject(object.highlyStructuredMessage); + } + if (object.imageMessage != null) { + if (typeof object.imageMessage !== "object") + throw TypeError(".proto.FourRowTemplate.imageMessage: object expected"); + message.imageMessage = $root.proto.ImageMessage.fromObject(object.imageMessage); + } + if (object.videoMessage != null) { + if (typeof object.videoMessage !== "object") + throw TypeError(".proto.FourRowTemplate.videoMessage: object expected"); + message.videoMessage = $root.proto.VideoMessage.fromObject(object.videoMessage); + } + if (object.locationMessage != null) { + if (typeof object.locationMessage !== "object") + throw TypeError(".proto.FourRowTemplate.locationMessage: object expected"); + message.locationMessage = $root.proto.LocationMessage.fromObject(object.locationMessage); + } + return message; + }; + + /** + * Creates a plain object from a FourRowTemplate message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.FourRowTemplate + * @static + * @param {proto.FourRowTemplate} message FourRowTemplate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FourRowTemplate.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.buttons = []; + if (options.defaults) { + object.content = null; + object.footer = null; + } + if (message.documentMessage != null && message.hasOwnProperty("documentMessage")) { + object.documentMessage = $root.proto.DocumentMessage.toObject(message.documentMessage, options); + if (options.oneofs) + object.title = "documentMessage"; + } + if (message.highlyStructuredMessage != null && message.hasOwnProperty("highlyStructuredMessage")) { + object.highlyStructuredMessage = $root.proto.HighlyStructuredMessage.toObject(message.highlyStructuredMessage, options); + if (options.oneofs) + object.title = "highlyStructuredMessage"; + } + if (message.imageMessage != null && message.hasOwnProperty("imageMessage")) { + object.imageMessage = $root.proto.ImageMessage.toObject(message.imageMessage, options); + if (options.oneofs) + object.title = "imageMessage"; + } + if (message.videoMessage != null && message.hasOwnProperty("videoMessage")) { + object.videoMessage = $root.proto.VideoMessage.toObject(message.videoMessage, options); + if (options.oneofs) + object.title = "videoMessage"; + } + if (message.locationMessage != null && message.hasOwnProperty("locationMessage")) { + object.locationMessage = $root.proto.LocationMessage.toObject(message.locationMessage, options); + if (options.oneofs) + object.title = "locationMessage"; + } + if (message.content != null && message.hasOwnProperty("content")) + object.content = $root.proto.HighlyStructuredMessage.toObject(message.content, options); + if (message.footer != null && message.hasOwnProperty("footer")) + object.footer = $root.proto.HighlyStructuredMessage.toObject(message.footer, options); + if (message.buttons && message.buttons.length) { + object.buttons = []; + for (var j = 0; j < message.buttons.length; ++j) + object.buttons[j] = $root.proto.TemplateButton.toObject(message.buttons[j], options); + } + return object; + }; + + /** + * Converts this FourRowTemplate to JSON. + * @function toJSON + * @memberof proto.FourRowTemplate + * @instance + * @returns {Object.} JSON object + */ + FourRowTemplate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FourRowTemplate; + })(); + + proto.HydratedFourRowTemplate = (function() { + + /** + * Properties of a HydratedFourRowTemplate. + * @memberof proto + * @interface IHydratedFourRowTemplate + * @property {string|null} [hydratedContentText] HydratedFourRowTemplate hydratedContentText + * @property {string|null} [hydratedFooterText] HydratedFourRowTemplate hydratedFooterText + * @property {Array.|null} [hydratedButtons] HydratedFourRowTemplate hydratedButtons + * @property {string|null} [templateId] HydratedFourRowTemplate templateId + * @property {proto.IDocumentMessage|null} [documentMessage] HydratedFourRowTemplate documentMessage + * @property {string|null} [hydratedTitleText] HydratedFourRowTemplate hydratedTitleText + * @property {proto.IImageMessage|null} [imageMessage] HydratedFourRowTemplate imageMessage + * @property {proto.IVideoMessage|null} [videoMessage] HydratedFourRowTemplate videoMessage + * @property {proto.ILocationMessage|null} [locationMessage] HydratedFourRowTemplate locationMessage + */ + + /** + * Constructs a new HydratedFourRowTemplate. + * @memberof proto + * @classdesc Represents a HydratedFourRowTemplate. + * @implements IHydratedFourRowTemplate + * @constructor + * @param {proto.IHydratedFourRowTemplate=} [properties] Properties to set + */ + function HydratedFourRowTemplate(properties) { + this.hydratedButtons = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HydratedFourRowTemplate hydratedContentText. + * @member {string} hydratedContentText + * @memberof proto.HydratedFourRowTemplate + * @instance + */ + HydratedFourRowTemplate.prototype.hydratedContentText = ""; + + /** + * HydratedFourRowTemplate hydratedFooterText. + * @member {string} hydratedFooterText + * @memberof proto.HydratedFourRowTemplate + * @instance + */ + HydratedFourRowTemplate.prototype.hydratedFooterText = ""; + + /** + * HydratedFourRowTemplate hydratedButtons. + * @member {Array.} hydratedButtons + * @memberof proto.HydratedFourRowTemplate + * @instance + */ + HydratedFourRowTemplate.prototype.hydratedButtons = $util.emptyArray; + + /** + * HydratedFourRowTemplate templateId. + * @member {string} templateId + * @memberof proto.HydratedFourRowTemplate + * @instance + */ + HydratedFourRowTemplate.prototype.templateId = ""; + + /** + * HydratedFourRowTemplate documentMessage. + * @member {proto.IDocumentMessage|null|undefined} documentMessage + * @memberof proto.HydratedFourRowTemplate + * @instance + */ + HydratedFourRowTemplate.prototype.documentMessage = null; + + /** + * HydratedFourRowTemplate hydratedTitleText. + * @member {string} hydratedTitleText + * @memberof proto.HydratedFourRowTemplate + * @instance + */ + HydratedFourRowTemplate.prototype.hydratedTitleText = ""; + + /** + * HydratedFourRowTemplate imageMessage. + * @member {proto.IImageMessage|null|undefined} imageMessage + * @memberof proto.HydratedFourRowTemplate + * @instance + */ + HydratedFourRowTemplate.prototype.imageMessage = null; + + /** + * HydratedFourRowTemplate videoMessage. + * @member {proto.IVideoMessage|null|undefined} videoMessage + * @memberof proto.HydratedFourRowTemplate + * @instance + */ + HydratedFourRowTemplate.prototype.videoMessage = null; + + /** + * HydratedFourRowTemplate locationMessage. + * @member {proto.ILocationMessage|null|undefined} locationMessage + * @memberof proto.HydratedFourRowTemplate + * @instance + */ + HydratedFourRowTemplate.prototype.locationMessage = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HydratedFourRowTemplate title. + * @member {"documentMessage"|"hydratedTitleText"|"imageMessage"|"videoMessage"|"locationMessage"|undefined} title + * @memberof proto.HydratedFourRowTemplate + * @instance + */ + Object.defineProperty(HydratedFourRowTemplate.prototype, "title", { + get: $util.oneOfGetter($oneOfFields = ["documentMessage", "hydratedTitleText", "imageMessage", "videoMessage", "locationMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HydratedFourRowTemplate instance using the specified properties. + * @function create + * @memberof proto.HydratedFourRowTemplate + * @static + * @param {proto.IHydratedFourRowTemplate=} [properties] Properties to set + * @returns {proto.HydratedFourRowTemplate} HydratedFourRowTemplate instance + */ + HydratedFourRowTemplate.create = function create(properties) { + return new HydratedFourRowTemplate(properties); + }; + + /** + * Encodes the specified HydratedFourRowTemplate message. Does not implicitly {@link proto.HydratedFourRowTemplate.verify|verify} messages. + * @function encode + * @memberof proto.HydratedFourRowTemplate + * @static + * @param {proto.IHydratedFourRowTemplate} message HydratedFourRowTemplate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HydratedFourRowTemplate.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.documentMessage != null && Object.hasOwnProperty.call(message, "documentMessage")) + $root.proto.DocumentMessage.encode(message.documentMessage, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.hydratedTitleText != null && Object.hasOwnProperty.call(message, "hydratedTitleText")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.hydratedTitleText); + if (message.imageMessage != null && Object.hasOwnProperty.call(message, "imageMessage")) + $root.proto.ImageMessage.encode(message.imageMessage, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.videoMessage != null && Object.hasOwnProperty.call(message, "videoMessage")) + $root.proto.VideoMessage.encode(message.videoMessage, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.locationMessage != null && Object.hasOwnProperty.call(message, "locationMessage")) + $root.proto.LocationMessage.encode(message.locationMessage, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.hydratedContentText != null && Object.hasOwnProperty.call(message, "hydratedContentText")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.hydratedContentText); + if (message.hydratedFooterText != null && Object.hasOwnProperty.call(message, "hydratedFooterText")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.hydratedFooterText); + if (message.hydratedButtons != null && message.hydratedButtons.length) + for (var i = 0; i < message.hydratedButtons.length; ++i) + $root.proto.HydratedTemplateButton.encode(message.hydratedButtons[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.templateId != null && Object.hasOwnProperty.call(message, "templateId")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.templateId); + return writer; + }; + + /** + * Encodes the specified HydratedFourRowTemplate message, length delimited. Does not implicitly {@link proto.HydratedFourRowTemplate.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.HydratedFourRowTemplate + * @static + * @param {proto.IHydratedFourRowTemplate} message HydratedFourRowTemplate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HydratedFourRowTemplate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HydratedFourRowTemplate message from the specified reader or buffer. + * @function decode + * @memberof proto.HydratedFourRowTemplate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.HydratedFourRowTemplate} HydratedFourRowTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HydratedFourRowTemplate.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.HydratedFourRowTemplate(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 6: + message.hydratedContentText = reader.string(); + break; + case 7: + message.hydratedFooterText = reader.string(); + break; + case 8: + if (!(message.hydratedButtons && message.hydratedButtons.length)) + message.hydratedButtons = []; + message.hydratedButtons.push($root.proto.HydratedTemplateButton.decode(reader, reader.uint32())); + break; + case 9: + message.templateId = reader.string(); + break; + case 1: + message.documentMessage = $root.proto.DocumentMessage.decode(reader, reader.uint32()); + break; + case 2: + message.hydratedTitleText = reader.string(); + break; + case 3: + message.imageMessage = $root.proto.ImageMessage.decode(reader, reader.uint32()); + break; + case 4: + message.videoMessage = $root.proto.VideoMessage.decode(reader, reader.uint32()); + break; + case 5: + message.locationMessage = $root.proto.LocationMessage.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HydratedFourRowTemplate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.HydratedFourRowTemplate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.HydratedFourRowTemplate} HydratedFourRowTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HydratedFourRowTemplate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HydratedFourRowTemplate message. + * @function verify + * @memberof proto.HydratedFourRowTemplate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HydratedFourRowTemplate.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.hydratedContentText != null && message.hasOwnProperty("hydratedContentText")) + if (!$util.isString(message.hydratedContentText)) + return "hydratedContentText: string expected"; + if (message.hydratedFooterText != null && message.hasOwnProperty("hydratedFooterText")) + if (!$util.isString(message.hydratedFooterText)) + return "hydratedFooterText: string expected"; + if (message.hydratedButtons != null && message.hasOwnProperty("hydratedButtons")) { + if (!Array.isArray(message.hydratedButtons)) + return "hydratedButtons: array expected"; + for (var i = 0; i < message.hydratedButtons.length; ++i) { + var error = $root.proto.HydratedTemplateButton.verify(message.hydratedButtons[i]); + if (error) + return "hydratedButtons." + error; + } + } + if (message.templateId != null && message.hasOwnProperty("templateId")) + if (!$util.isString(message.templateId)) + return "templateId: string expected"; + if (message.documentMessage != null && message.hasOwnProperty("documentMessage")) { + properties.title = 1; + { + var error = $root.proto.DocumentMessage.verify(message.documentMessage); + if (error) + return "documentMessage." + error; + } + } + if (message.hydratedTitleText != null && message.hasOwnProperty("hydratedTitleText")) { + if (properties.title === 1) + return "title: multiple values"; + properties.title = 1; + if (!$util.isString(message.hydratedTitleText)) + return "hydratedTitleText: string expected"; + } + if (message.imageMessage != null && message.hasOwnProperty("imageMessage")) { + if (properties.title === 1) + return "title: multiple values"; + properties.title = 1; + { + var error = $root.proto.ImageMessage.verify(message.imageMessage); + if (error) + return "imageMessage." + error; + } + } + if (message.videoMessage != null && message.hasOwnProperty("videoMessage")) { + if (properties.title === 1) + return "title: multiple values"; + properties.title = 1; + { + var error = $root.proto.VideoMessage.verify(message.videoMessage); + if (error) + return "videoMessage." + error; + } + } + if (message.locationMessage != null && message.hasOwnProperty("locationMessage")) { + if (properties.title === 1) + return "title: multiple values"; + properties.title = 1; + { + var error = $root.proto.LocationMessage.verify(message.locationMessage); + if (error) + return "locationMessage." + error; + } + } + return null; + }; + + /** + * Creates a HydratedFourRowTemplate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.HydratedFourRowTemplate + * @static + * @param {Object.} object Plain object + * @returns {proto.HydratedFourRowTemplate} HydratedFourRowTemplate + */ + HydratedFourRowTemplate.fromObject = function fromObject(object) { + if (object instanceof $root.proto.HydratedFourRowTemplate) + return object; + var message = new $root.proto.HydratedFourRowTemplate(); + if (object.hydratedContentText != null) + message.hydratedContentText = String(object.hydratedContentText); + if (object.hydratedFooterText != null) + message.hydratedFooterText = String(object.hydratedFooterText); + if (object.hydratedButtons) { + if (!Array.isArray(object.hydratedButtons)) + throw TypeError(".proto.HydratedFourRowTemplate.hydratedButtons: array expected"); + message.hydratedButtons = []; + for (var i = 0; i < object.hydratedButtons.length; ++i) { + if (typeof object.hydratedButtons[i] !== "object") + throw TypeError(".proto.HydratedFourRowTemplate.hydratedButtons: object expected"); + message.hydratedButtons[i] = $root.proto.HydratedTemplateButton.fromObject(object.hydratedButtons[i]); + } + } + if (object.templateId != null) + message.templateId = String(object.templateId); + if (object.documentMessage != null) { + if (typeof object.documentMessage !== "object") + throw TypeError(".proto.HydratedFourRowTemplate.documentMessage: object expected"); + message.documentMessage = $root.proto.DocumentMessage.fromObject(object.documentMessage); + } + if (object.hydratedTitleText != null) + message.hydratedTitleText = String(object.hydratedTitleText); + if (object.imageMessage != null) { + if (typeof object.imageMessage !== "object") + throw TypeError(".proto.HydratedFourRowTemplate.imageMessage: object expected"); + message.imageMessage = $root.proto.ImageMessage.fromObject(object.imageMessage); + } + if (object.videoMessage != null) { + if (typeof object.videoMessage !== "object") + throw TypeError(".proto.HydratedFourRowTemplate.videoMessage: object expected"); + message.videoMessage = $root.proto.VideoMessage.fromObject(object.videoMessage); + } + if (object.locationMessage != null) { + if (typeof object.locationMessage !== "object") + throw TypeError(".proto.HydratedFourRowTemplate.locationMessage: object expected"); + message.locationMessage = $root.proto.LocationMessage.fromObject(object.locationMessage); + } + return message; + }; + + /** + * Creates a plain object from a HydratedFourRowTemplate message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.HydratedFourRowTemplate + * @static + * @param {proto.HydratedFourRowTemplate} message HydratedFourRowTemplate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HydratedFourRowTemplate.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.hydratedButtons = []; + if (options.defaults) { + object.hydratedContentText = ""; + object.hydratedFooterText = ""; + object.templateId = ""; + } + if (message.documentMessage != null && message.hasOwnProperty("documentMessage")) { + object.documentMessage = $root.proto.DocumentMessage.toObject(message.documentMessage, options); + if (options.oneofs) + object.title = "documentMessage"; + } + if (message.hydratedTitleText != null && message.hasOwnProperty("hydratedTitleText")) { + object.hydratedTitleText = message.hydratedTitleText; + if (options.oneofs) + object.title = "hydratedTitleText"; + } + if (message.imageMessage != null && message.hasOwnProperty("imageMessage")) { + object.imageMessage = $root.proto.ImageMessage.toObject(message.imageMessage, options); + if (options.oneofs) + object.title = "imageMessage"; + } + if (message.videoMessage != null && message.hasOwnProperty("videoMessage")) { + object.videoMessage = $root.proto.VideoMessage.toObject(message.videoMessage, options); + if (options.oneofs) + object.title = "videoMessage"; + } + if (message.locationMessage != null && message.hasOwnProperty("locationMessage")) { + object.locationMessage = $root.proto.LocationMessage.toObject(message.locationMessage, options); + if (options.oneofs) + object.title = "locationMessage"; + } + if (message.hydratedContentText != null && message.hasOwnProperty("hydratedContentText")) + object.hydratedContentText = message.hydratedContentText; + if (message.hydratedFooterText != null && message.hasOwnProperty("hydratedFooterText")) + object.hydratedFooterText = message.hydratedFooterText; + if (message.hydratedButtons && message.hydratedButtons.length) { + object.hydratedButtons = []; + for (var j = 0; j < message.hydratedButtons.length; ++j) + object.hydratedButtons[j] = $root.proto.HydratedTemplateButton.toObject(message.hydratedButtons[j], options); + } + if (message.templateId != null && message.hasOwnProperty("templateId")) + object.templateId = message.templateId; + return object; + }; + + /** + * Converts this HydratedFourRowTemplate to JSON. + * @function toJSON + * @memberof proto.HydratedFourRowTemplate + * @instance + * @returns {Object.} JSON object + */ + HydratedFourRowTemplate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return HydratedFourRowTemplate; + })(); + + proto.TemplateMessage = (function() { + + /** + * Properties of a TemplateMessage. + * @memberof proto + * @interface ITemplateMessage + * @property {proto.IContextInfo|null} [contextInfo] TemplateMessage contextInfo + * @property {proto.IHydratedFourRowTemplate|null} [hydratedTemplate] TemplateMessage hydratedTemplate + * @property {proto.IFourRowTemplate|null} [fourRowTemplate] TemplateMessage fourRowTemplate + * @property {proto.IHydratedFourRowTemplate|null} [hydratedFourRowTemplate] TemplateMessage hydratedFourRowTemplate + */ + + /** + * Constructs a new TemplateMessage. + * @memberof proto + * @classdesc Represents a TemplateMessage. + * @implements ITemplateMessage + * @constructor + * @param {proto.ITemplateMessage=} [properties] Properties to set + */ + function TemplateMessage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TemplateMessage contextInfo. + * @member {proto.IContextInfo|null|undefined} contextInfo + * @memberof proto.TemplateMessage + * @instance + */ + TemplateMessage.prototype.contextInfo = null; + + /** + * TemplateMessage hydratedTemplate. + * @member {proto.IHydratedFourRowTemplate|null|undefined} hydratedTemplate + * @memberof proto.TemplateMessage + * @instance + */ + TemplateMessage.prototype.hydratedTemplate = null; + + /** + * TemplateMessage fourRowTemplate. + * @member {proto.IFourRowTemplate|null|undefined} fourRowTemplate + * @memberof proto.TemplateMessage + * @instance + */ + TemplateMessage.prototype.fourRowTemplate = null; + + /** + * TemplateMessage hydratedFourRowTemplate. + * @member {proto.IHydratedFourRowTemplate|null|undefined} hydratedFourRowTemplate + * @memberof proto.TemplateMessage + * @instance + */ + TemplateMessage.prototype.hydratedFourRowTemplate = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TemplateMessage format. + * @member {"fourRowTemplate"|"hydratedFourRowTemplate"|undefined} format + * @memberof proto.TemplateMessage + * @instance + */ + Object.defineProperty(TemplateMessage.prototype, "format", { + get: $util.oneOfGetter($oneOfFields = ["fourRowTemplate", "hydratedFourRowTemplate"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TemplateMessage instance using the specified properties. + * @function create + * @memberof proto.TemplateMessage + * @static + * @param {proto.ITemplateMessage=} [properties] Properties to set + * @returns {proto.TemplateMessage} TemplateMessage instance + */ + TemplateMessage.create = function create(properties) { + return new TemplateMessage(properties); + }; + + /** + * Encodes the specified TemplateMessage message. Does not implicitly {@link proto.TemplateMessage.verify|verify} messages. + * @function encode + * @memberof proto.TemplateMessage + * @static + * @param {proto.ITemplateMessage} message TemplateMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TemplateMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fourRowTemplate != null && Object.hasOwnProperty.call(message, "fourRowTemplate")) + $root.proto.FourRowTemplate.encode(message.fourRowTemplate, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.hydratedFourRowTemplate != null && Object.hasOwnProperty.call(message, "hydratedFourRowTemplate")) + $root.proto.HydratedFourRowTemplate.encode(message.hydratedFourRowTemplate, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.contextInfo != null && Object.hasOwnProperty.call(message, "contextInfo")) + $root.proto.ContextInfo.encode(message.contextInfo, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.hydratedTemplate != null && Object.hasOwnProperty.call(message, "hydratedTemplate")) + $root.proto.HydratedFourRowTemplate.encode(message.hydratedTemplate, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TemplateMessage message, length delimited. Does not implicitly {@link proto.TemplateMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.TemplateMessage + * @static + * @param {proto.ITemplateMessage} message TemplateMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TemplateMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TemplateMessage message from the specified reader or buffer. + * @function decode + * @memberof proto.TemplateMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.TemplateMessage} TemplateMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TemplateMessage.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.TemplateMessage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: + message.contextInfo = $root.proto.ContextInfo.decode(reader, reader.uint32()); + break; + case 4: + message.hydratedTemplate = $root.proto.HydratedFourRowTemplate.decode(reader, reader.uint32()); + break; + case 1: + message.fourRowTemplate = $root.proto.FourRowTemplate.decode(reader, reader.uint32()); + break; + case 2: + message.hydratedFourRowTemplate = $root.proto.HydratedFourRowTemplate.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TemplateMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.TemplateMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.TemplateMessage} TemplateMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TemplateMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TemplateMessage message. + * @function verify + * @memberof proto.TemplateMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TemplateMessage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) { + var error = $root.proto.ContextInfo.verify(message.contextInfo); + if (error) + return "contextInfo." + error; + } + if (message.hydratedTemplate != null && message.hasOwnProperty("hydratedTemplate")) { + var error = $root.proto.HydratedFourRowTemplate.verify(message.hydratedTemplate); + if (error) + return "hydratedTemplate." + error; + } + if (message.fourRowTemplate != null && message.hasOwnProperty("fourRowTemplate")) { + properties.format = 1; + { + var error = $root.proto.FourRowTemplate.verify(message.fourRowTemplate); + if (error) + return "fourRowTemplate." + error; + } + } + if (message.hydratedFourRowTemplate != null && message.hasOwnProperty("hydratedFourRowTemplate")) { + if (properties.format === 1) + return "format: multiple values"; + properties.format = 1; + { + var error = $root.proto.HydratedFourRowTemplate.verify(message.hydratedFourRowTemplate); + if (error) + return "hydratedFourRowTemplate." + error; + } + } + return null; + }; + + /** + * Creates a TemplateMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.TemplateMessage + * @static + * @param {Object.} object Plain object + * @returns {proto.TemplateMessage} TemplateMessage + */ + TemplateMessage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.TemplateMessage) + return object; + var message = new $root.proto.TemplateMessage(); + if (object.contextInfo != null) { + if (typeof object.contextInfo !== "object") + throw TypeError(".proto.TemplateMessage.contextInfo: object expected"); + message.contextInfo = $root.proto.ContextInfo.fromObject(object.contextInfo); + } + if (object.hydratedTemplate != null) { + if (typeof object.hydratedTemplate !== "object") + throw TypeError(".proto.TemplateMessage.hydratedTemplate: object expected"); + message.hydratedTemplate = $root.proto.HydratedFourRowTemplate.fromObject(object.hydratedTemplate); + } + if (object.fourRowTemplate != null) { + if (typeof object.fourRowTemplate !== "object") + throw TypeError(".proto.TemplateMessage.fourRowTemplate: object expected"); + message.fourRowTemplate = $root.proto.FourRowTemplate.fromObject(object.fourRowTemplate); + } + if (object.hydratedFourRowTemplate != null) { + if (typeof object.hydratedFourRowTemplate !== "object") + throw TypeError(".proto.TemplateMessage.hydratedFourRowTemplate: object expected"); + message.hydratedFourRowTemplate = $root.proto.HydratedFourRowTemplate.fromObject(object.hydratedFourRowTemplate); + } + return message; + }; + + /** + * Creates a plain object from a TemplateMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.TemplateMessage + * @static + * @param {proto.TemplateMessage} message TemplateMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TemplateMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.contextInfo = null; + object.hydratedTemplate = null; + } + if (message.fourRowTemplate != null && message.hasOwnProperty("fourRowTemplate")) { + object.fourRowTemplate = $root.proto.FourRowTemplate.toObject(message.fourRowTemplate, options); + if (options.oneofs) + object.format = "fourRowTemplate"; + } + if (message.hydratedFourRowTemplate != null && message.hasOwnProperty("hydratedFourRowTemplate")) { + object.hydratedFourRowTemplate = $root.proto.HydratedFourRowTemplate.toObject(message.hydratedFourRowTemplate, options); + if (options.oneofs) + object.format = "hydratedFourRowTemplate"; + } + if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) + object.contextInfo = $root.proto.ContextInfo.toObject(message.contextInfo, options); + if (message.hydratedTemplate != null && message.hasOwnProperty("hydratedTemplate")) + object.hydratedTemplate = $root.proto.HydratedFourRowTemplate.toObject(message.hydratedTemplate, options); + return object; + }; + + /** + * Converts this TemplateMessage to JSON. + * @function toJSON + * @memberof proto.TemplateMessage + * @instance + * @returns {Object.} JSON object + */ + TemplateMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TemplateMessage; + })(); + + proto.TemplateButtonReplyMessage = (function() { + + /** + * Properties of a TemplateButtonReplyMessage. + * @memberof proto + * @interface ITemplateButtonReplyMessage + * @property {string|null} [selectedId] TemplateButtonReplyMessage selectedId + * @property {string|null} [selectedDisplayText] TemplateButtonReplyMessage selectedDisplayText + * @property {proto.IContextInfo|null} [contextInfo] TemplateButtonReplyMessage contextInfo + * @property {number|null} [selectedIndex] TemplateButtonReplyMessage selectedIndex + */ + + /** + * Constructs a new TemplateButtonReplyMessage. + * @memberof proto + * @classdesc Represents a TemplateButtonReplyMessage. + * @implements ITemplateButtonReplyMessage + * @constructor + * @param {proto.ITemplateButtonReplyMessage=} [properties] Properties to set + */ + function TemplateButtonReplyMessage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TemplateButtonReplyMessage selectedId. + * @member {string} selectedId + * @memberof proto.TemplateButtonReplyMessage + * @instance + */ + TemplateButtonReplyMessage.prototype.selectedId = ""; + + /** + * TemplateButtonReplyMessage selectedDisplayText. + * @member {string} selectedDisplayText + * @memberof proto.TemplateButtonReplyMessage + * @instance + */ + TemplateButtonReplyMessage.prototype.selectedDisplayText = ""; + + /** + * TemplateButtonReplyMessage contextInfo. + * @member {proto.IContextInfo|null|undefined} contextInfo + * @memberof proto.TemplateButtonReplyMessage + * @instance + */ + TemplateButtonReplyMessage.prototype.contextInfo = null; + + /** + * TemplateButtonReplyMessage selectedIndex. + * @member {number} selectedIndex + * @memberof proto.TemplateButtonReplyMessage + * @instance + */ + TemplateButtonReplyMessage.prototype.selectedIndex = 0; + + /** + * Creates a new TemplateButtonReplyMessage instance using the specified properties. + * @function create + * @memberof proto.TemplateButtonReplyMessage + * @static + * @param {proto.ITemplateButtonReplyMessage=} [properties] Properties to set + * @returns {proto.TemplateButtonReplyMessage} TemplateButtonReplyMessage instance + */ + TemplateButtonReplyMessage.create = function create(properties) { + return new TemplateButtonReplyMessage(properties); + }; + + /** + * Encodes the specified TemplateButtonReplyMessage message. Does not implicitly {@link proto.TemplateButtonReplyMessage.verify|verify} messages. + * @function encode + * @memberof proto.TemplateButtonReplyMessage + * @static + * @param {proto.ITemplateButtonReplyMessage} message TemplateButtonReplyMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TemplateButtonReplyMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selectedId != null && Object.hasOwnProperty.call(message, "selectedId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selectedId); + if (message.selectedDisplayText != null && Object.hasOwnProperty.call(message, "selectedDisplayText")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.selectedDisplayText); + if (message.contextInfo != null && Object.hasOwnProperty.call(message, "contextInfo")) + $root.proto.ContextInfo.encode(message.contextInfo, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.selectedIndex != null && Object.hasOwnProperty.call(message, "selectedIndex")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.selectedIndex); + return writer; + }; + + /** + * Encodes the specified TemplateButtonReplyMessage message, length delimited. Does not implicitly {@link proto.TemplateButtonReplyMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.TemplateButtonReplyMessage + * @static + * @param {proto.ITemplateButtonReplyMessage} message TemplateButtonReplyMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TemplateButtonReplyMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TemplateButtonReplyMessage message from the specified reader or buffer. + * @function decode + * @memberof proto.TemplateButtonReplyMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.TemplateButtonReplyMessage} TemplateButtonReplyMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TemplateButtonReplyMessage.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.TemplateButtonReplyMessage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.selectedId = reader.string(); + break; + case 2: + message.selectedDisplayText = reader.string(); + break; + case 3: + message.contextInfo = $root.proto.ContextInfo.decode(reader, reader.uint32()); + break; + case 4: + message.selectedIndex = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TemplateButtonReplyMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.TemplateButtonReplyMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.TemplateButtonReplyMessage} TemplateButtonReplyMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TemplateButtonReplyMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TemplateButtonReplyMessage message. + * @function verify + * @memberof proto.TemplateButtonReplyMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TemplateButtonReplyMessage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.selectedId != null && message.hasOwnProperty("selectedId")) + if (!$util.isString(message.selectedId)) + return "selectedId: string expected"; + if (message.selectedDisplayText != null && message.hasOwnProperty("selectedDisplayText")) + if (!$util.isString(message.selectedDisplayText)) + return "selectedDisplayText: string expected"; + if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) { + var error = $root.proto.ContextInfo.verify(message.contextInfo); + if (error) + return "contextInfo." + error; + } + if (message.selectedIndex != null && message.hasOwnProperty("selectedIndex")) + if (!$util.isInteger(message.selectedIndex)) + return "selectedIndex: integer expected"; + return null; + }; + + /** + * Creates a TemplateButtonReplyMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.TemplateButtonReplyMessage + * @static + * @param {Object.} object Plain object + * @returns {proto.TemplateButtonReplyMessage} TemplateButtonReplyMessage + */ + TemplateButtonReplyMessage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.TemplateButtonReplyMessage) + return object; + var message = new $root.proto.TemplateButtonReplyMessage(); + if (object.selectedId != null) + message.selectedId = String(object.selectedId); + if (object.selectedDisplayText != null) + message.selectedDisplayText = String(object.selectedDisplayText); + if (object.contextInfo != null) { + if (typeof object.contextInfo !== "object") + throw TypeError(".proto.TemplateButtonReplyMessage.contextInfo: object expected"); + message.contextInfo = $root.proto.ContextInfo.fromObject(object.contextInfo); + } + if (object.selectedIndex != null) + message.selectedIndex = object.selectedIndex >>> 0; + return message; + }; + + /** + * Creates a plain object from a TemplateButtonReplyMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.TemplateButtonReplyMessage + * @static + * @param {proto.TemplateButtonReplyMessage} message TemplateButtonReplyMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TemplateButtonReplyMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.selectedId = ""; + object.selectedDisplayText = ""; + object.contextInfo = null; + object.selectedIndex = 0; + } + if (message.selectedId != null && message.hasOwnProperty("selectedId")) + object.selectedId = message.selectedId; + if (message.selectedDisplayText != null && message.hasOwnProperty("selectedDisplayText")) + object.selectedDisplayText = message.selectedDisplayText; + if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) + object.contextInfo = $root.proto.ContextInfo.toObject(message.contextInfo, options); + if (message.selectedIndex != null && message.hasOwnProperty("selectedIndex")) + object.selectedIndex = message.selectedIndex; + return object; + }; + + /** + * Converts this TemplateButtonReplyMessage to JSON. + * @function toJSON + * @memberof proto.TemplateButtonReplyMessage + * @instance + * @returns {Object.} JSON object + */ + TemplateButtonReplyMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TemplateButtonReplyMessage; + })(); + + proto.ProductSnapshot = (function() { + + /** + * Properties of a ProductSnapshot. + * @memberof proto + * @interface IProductSnapshot + * @property {proto.IImageMessage|null} [productImage] ProductSnapshot productImage + * @property {string|null} [productId] ProductSnapshot productId + * @property {string|null} [title] ProductSnapshot title + * @property {string|null} [description] ProductSnapshot description + * @property {string|null} [currencyCode] ProductSnapshot currencyCode + * @property {number|Long|null} [priceAmount1000] ProductSnapshot priceAmount1000 + * @property {string|null} [retailerId] ProductSnapshot retailerId + * @property {string|null} [url] ProductSnapshot url + * @property {number|null} [productImageCount] ProductSnapshot productImageCount + * @property {string|null} [firstImageId] ProductSnapshot firstImageId + */ + + /** + * Constructs a new ProductSnapshot. + * @memberof proto + * @classdesc Represents a ProductSnapshot. + * @implements IProductSnapshot + * @constructor + * @param {proto.IProductSnapshot=} [properties] Properties to set + */ + function ProductSnapshot(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ProductSnapshot productImage. + * @member {proto.IImageMessage|null|undefined} productImage + * @memberof proto.ProductSnapshot + * @instance + */ + ProductSnapshot.prototype.productImage = null; + + /** + * ProductSnapshot productId. + * @member {string} productId + * @memberof proto.ProductSnapshot + * @instance + */ + ProductSnapshot.prototype.productId = ""; + + /** + * ProductSnapshot title. + * @member {string} title + * @memberof proto.ProductSnapshot + * @instance + */ + ProductSnapshot.prototype.title = ""; + + /** + * ProductSnapshot description. + * @member {string} description + * @memberof proto.ProductSnapshot + * @instance + */ + ProductSnapshot.prototype.description = ""; + + /** + * ProductSnapshot currencyCode. + * @member {string} currencyCode + * @memberof proto.ProductSnapshot + * @instance + */ + ProductSnapshot.prototype.currencyCode = ""; + + /** + * ProductSnapshot priceAmount1000. + * @member {number|Long} priceAmount1000 + * @memberof proto.ProductSnapshot + * @instance + */ + ProductSnapshot.prototype.priceAmount1000 = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ProductSnapshot retailerId. + * @member {string} retailerId + * @memberof proto.ProductSnapshot + * @instance + */ + ProductSnapshot.prototype.retailerId = ""; + + /** + * ProductSnapshot url. + * @member {string} url + * @memberof proto.ProductSnapshot + * @instance + */ + ProductSnapshot.prototype.url = ""; + + /** + * ProductSnapshot productImageCount. + * @member {number} productImageCount + * @memberof proto.ProductSnapshot + * @instance + */ + ProductSnapshot.prototype.productImageCount = 0; + + /** + * ProductSnapshot firstImageId. + * @member {string} firstImageId + * @memberof proto.ProductSnapshot + * @instance + */ + ProductSnapshot.prototype.firstImageId = ""; + + /** + * Creates a new ProductSnapshot instance using the specified properties. + * @function create + * @memberof proto.ProductSnapshot + * @static + * @param {proto.IProductSnapshot=} [properties] Properties to set + * @returns {proto.ProductSnapshot} ProductSnapshot instance + */ + ProductSnapshot.create = function create(properties) { + return new ProductSnapshot(properties); + }; + + /** + * Encodes the specified ProductSnapshot message. Does not implicitly {@link proto.ProductSnapshot.verify|verify} messages. + * @function encode + * @memberof proto.ProductSnapshot + * @static + * @param {proto.IProductSnapshot} message ProductSnapshot message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProductSnapshot.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.productImage != null && Object.hasOwnProperty.call(message, "productImage")) + $root.proto.ImageMessage.encode(message.productImage, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.productId != null && Object.hasOwnProperty.call(message, "productId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.productId); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.title); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.description); + if (message.currencyCode != null && Object.hasOwnProperty.call(message, "currencyCode")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.currencyCode); + if (message.priceAmount1000 != null && Object.hasOwnProperty.call(message, "priceAmount1000")) + writer.uint32(/* id 6, wireType 0 =*/48).int64(message.priceAmount1000); + if (message.retailerId != null && Object.hasOwnProperty.call(message, "retailerId")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.retailerId); + if (message.url != null && Object.hasOwnProperty.call(message, "url")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.url); + if (message.productImageCount != null && Object.hasOwnProperty.call(message, "productImageCount")) + writer.uint32(/* id 9, wireType 0 =*/72).uint32(message.productImageCount); + if (message.firstImageId != null && Object.hasOwnProperty.call(message, "firstImageId")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.firstImageId); + return writer; + }; + + /** + * Encodes the specified ProductSnapshot message, length delimited. Does not implicitly {@link proto.ProductSnapshot.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.ProductSnapshot + * @static + * @param {proto.IProductSnapshot} message ProductSnapshot message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProductSnapshot.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProductSnapshot message from the specified reader or buffer. + * @function decode + * @memberof proto.ProductSnapshot + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.ProductSnapshot} ProductSnapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProductSnapshot.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ProductSnapshot(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.productImage = $root.proto.ImageMessage.decode(reader, reader.uint32()); + break; + case 2: + message.productId = reader.string(); + break; + case 3: + message.title = reader.string(); + break; + case 4: + message.description = reader.string(); + break; + case 5: + message.currencyCode = reader.string(); + break; + case 6: + message.priceAmount1000 = reader.int64(); + break; + case 7: + message.retailerId = reader.string(); + break; + case 8: + message.url = reader.string(); + break; + case 9: + message.productImageCount = reader.uint32(); + break; + case 11: + message.firstImageId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProductSnapshot message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.ProductSnapshot + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.ProductSnapshot} ProductSnapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProductSnapshot.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProductSnapshot message. + * @function verify + * @memberof proto.ProductSnapshot + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProductSnapshot.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.productImage != null && message.hasOwnProperty("productImage")) { + var error = $root.proto.ImageMessage.verify(message.productImage); + if (error) + return "productImage." + error; + } + if (message.productId != null && message.hasOwnProperty("productId")) + if (!$util.isString(message.productId)) + return "productId: string expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) + if (!$util.isString(message.currencyCode)) + return "currencyCode: string expected"; + if (message.priceAmount1000 != null && message.hasOwnProperty("priceAmount1000")) + if (!$util.isInteger(message.priceAmount1000) && !(message.priceAmount1000 && $util.isInteger(message.priceAmount1000.low) && $util.isInteger(message.priceAmount1000.high))) + return "priceAmount1000: integer|Long expected"; + if (message.retailerId != null && message.hasOwnProperty("retailerId")) + if (!$util.isString(message.retailerId)) + return "retailerId: string expected"; + if (message.url != null && message.hasOwnProperty("url")) + if (!$util.isString(message.url)) + return "url: string expected"; + if (message.productImageCount != null && message.hasOwnProperty("productImageCount")) + if (!$util.isInteger(message.productImageCount)) + return "productImageCount: integer expected"; + if (message.firstImageId != null && message.hasOwnProperty("firstImageId")) + if (!$util.isString(message.firstImageId)) + return "firstImageId: string expected"; + return null; + }; + + /** + * Creates a ProductSnapshot message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.ProductSnapshot + * @static + * @param {Object.} object Plain object + * @returns {proto.ProductSnapshot} ProductSnapshot + */ + ProductSnapshot.fromObject = function fromObject(object) { + if (object instanceof $root.proto.ProductSnapshot) + return object; + var message = new $root.proto.ProductSnapshot(); + if (object.productImage != null) { + if (typeof object.productImage !== "object") + throw TypeError(".proto.ProductSnapshot.productImage: object expected"); + message.productImage = $root.proto.ImageMessage.fromObject(object.productImage); + } + if (object.productId != null) + message.productId = String(object.productId); + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + if (object.currencyCode != null) + message.currencyCode = String(object.currencyCode); + if (object.priceAmount1000 != null) + if ($util.Long) + (message.priceAmount1000 = $util.Long.fromValue(object.priceAmount1000)).unsigned = false; + else if (typeof object.priceAmount1000 === "string") + message.priceAmount1000 = parseInt(object.priceAmount1000, 10); + else if (typeof object.priceAmount1000 === "number") + message.priceAmount1000 = object.priceAmount1000; + else if (typeof object.priceAmount1000 === "object") + message.priceAmount1000 = new $util.LongBits(object.priceAmount1000.low >>> 0, object.priceAmount1000.high >>> 0).toNumber(); + if (object.retailerId != null) + message.retailerId = String(object.retailerId); + if (object.url != null) + message.url = String(object.url); + if (object.productImageCount != null) + message.productImageCount = object.productImageCount >>> 0; + if (object.firstImageId != null) + message.firstImageId = String(object.firstImageId); + return message; + }; + + /** + * Creates a plain object from a ProductSnapshot message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.ProductSnapshot + * @static + * @param {proto.ProductSnapshot} message ProductSnapshot + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProductSnapshot.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.productImage = null; + object.productId = ""; + object.title = ""; + object.description = ""; + object.currencyCode = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.priceAmount1000 = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.priceAmount1000 = options.longs === String ? "0" : 0; + object.retailerId = ""; + object.url = ""; + object.productImageCount = 0; + object.firstImageId = ""; + } + if (message.productImage != null && message.hasOwnProperty("productImage")) + object.productImage = $root.proto.ImageMessage.toObject(message.productImage, options); + if (message.productId != null && message.hasOwnProperty("productId")) + object.productId = message.productId; + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) + object.currencyCode = message.currencyCode; + if (message.priceAmount1000 != null && message.hasOwnProperty("priceAmount1000")) + if (typeof message.priceAmount1000 === "number") + object.priceAmount1000 = options.longs === String ? String(message.priceAmount1000) : message.priceAmount1000; + else + object.priceAmount1000 = options.longs === String ? $util.Long.prototype.toString.call(message.priceAmount1000) : options.longs === Number ? new $util.LongBits(message.priceAmount1000.low >>> 0, message.priceAmount1000.high >>> 0).toNumber() : message.priceAmount1000; + if (message.retailerId != null && message.hasOwnProperty("retailerId")) + object.retailerId = message.retailerId; + if (message.url != null && message.hasOwnProperty("url")) + object.url = message.url; + if (message.productImageCount != null && message.hasOwnProperty("productImageCount")) + object.productImageCount = message.productImageCount; + if (message.firstImageId != null && message.hasOwnProperty("firstImageId")) + object.firstImageId = message.firstImageId; + return object; + }; + + /** + * Converts this ProductSnapshot to JSON. + * @function toJSON + * @memberof proto.ProductSnapshot + * @instance + * @returns {Object.} JSON object + */ + ProductSnapshot.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ProductSnapshot; + })(); + + proto.ProductMessage = (function() { + + /** + * Properties of a ProductMessage. + * @memberof proto + * @interface IProductMessage + * @property {proto.IProductSnapshot|null} [product] ProductMessage product + * @property {string|null} [businessOwnerJid] ProductMessage businessOwnerJid + * @property {proto.IContextInfo|null} [contextInfo] ProductMessage contextInfo + */ + + /** + * Constructs a new ProductMessage. + * @memberof proto + * @classdesc Represents a ProductMessage. + * @implements IProductMessage + * @constructor + * @param {proto.IProductMessage=} [properties] Properties to set + */ + function ProductMessage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ProductMessage product. + * @member {proto.IProductSnapshot|null|undefined} product + * @memberof proto.ProductMessage + * @instance + */ + ProductMessage.prototype.product = null; + + /** + * ProductMessage businessOwnerJid. + * @member {string} businessOwnerJid + * @memberof proto.ProductMessage + * @instance + */ + ProductMessage.prototype.businessOwnerJid = ""; + + /** + * ProductMessage contextInfo. + * @member {proto.IContextInfo|null|undefined} contextInfo + * @memberof proto.ProductMessage + * @instance + */ + ProductMessage.prototype.contextInfo = null; + + /** + * Creates a new ProductMessage instance using the specified properties. + * @function create + * @memberof proto.ProductMessage + * @static + * @param {proto.IProductMessage=} [properties] Properties to set + * @returns {proto.ProductMessage} ProductMessage instance + */ + ProductMessage.create = function create(properties) { + return new ProductMessage(properties); + }; + + /** + * Encodes the specified ProductMessage message. Does not implicitly {@link proto.ProductMessage.verify|verify} messages. + * @function encode + * @memberof proto.ProductMessage + * @static + * @param {proto.IProductMessage} message ProductMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProductMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.product != null && Object.hasOwnProperty.call(message, "product")) + $root.proto.ProductSnapshot.encode(message.product, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.businessOwnerJid != null && Object.hasOwnProperty.call(message, "businessOwnerJid")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.businessOwnerJid); + if (message.contextInfo != null && Object.hasOwnProperty.call(message, "contextInfo")) + $root.proto.ContextInfo.encode(message.contextInfo, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ProductMessage message, length delimited. Does not implicitly {@link proto.ProductMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.ProductMessage + * @static + * @param {proto.IProductMessage} message ProductMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProductMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProductMessage message from the specified reader or buffer. + * @function decode + * @memberof proto.ProductMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.ProductMessage} ProductMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProductMessage.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ProductMessage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.product = $root.proto.ProductSnapshot.decode(reader, reader.uint32()); + break; + case 2: + message.businessOwnerJid = reader.string(); + break; + case 17: + message.contextInfo = $root.proto.ContextInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProductMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.ProductMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.ProductMessage} ProductMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProductMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProductMessage message. + * @function verify + * @memberof proto.ProductMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProductMessage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.product != null && message.hasOwnProperty("product")) { + var error = $root.proto.ProductSnapshot.verify(message.product); + if (error) + return "product." + error; + } + if (message.businessOwnerJid != null && message.hasOwnProperty("businessOwnerJid")) + if (!$util.isString(message.businessOwnerJid)) + return "businessOwnerJid: string expected"; + if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) { + var error = $root.proto.ContextInfo.verify(message.contextInfo); + if (error) + return "contextInfo." + error; + } + return null; + }; + + /** + * Creates a ProductMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.ProductMessage + * @static + * @param {Object.} object Plain object + * @returns {proto.ProductMessage} ProductMessage + */ + ProductMessage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.ProductMessage) + return object; + var message = new $root.proto.ProductMessage(); + if (object.product != null) { + if (typeof object.product !== "object") + throw TypeError(".proto.ProductMessage.product: object expected"); + message.product = $root.proto.ProductSnapshot.fromObject(object.product); + } + if (object.businessOwnerJid != null) + message.businessOwnerJid = String(object.businessOwnerJid); + if (object.contextInfo != null) { + if (typeof object.contextInfo !== "object") + throw TypeError(".proto.ProductMessage.contextInfo: object expected"); + message.contextInfo = $root.proto.ContextInfo.fromObject(object.contextInfo); + } + return message; + }; + + /** + * Creates a plain object from a ProductMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.ProductMessage + * @static + * @param {proto.ProductMessage} message ProductMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProductMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.product = null; + object.businessOwnerJid = ""; + object.contextInfo = null; + } + if (message.product != null && message.hasOwnProperty("product")) + object.product = $root.proto.ProductSnapshot.toObject(message.product, options); + if (message.businessOwnerJid != null && message.hasOwnProperty("businessOwnerJid")) + object.businessOwnerJid = message.businessOwnerJid; + if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) + object.contextInfo = $root.proto.ContextInfo.toObject(message.contextInfo, options); + return object; + }; + + /** + * Converts this ProductMessage to JSON. + * @function toJSON + * @memberof proto.ProductMessage + * @instance + * @returns {Object.} JSON object + */ + ProductMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ProductMessage; + })(); + + proto.GroupInviteMessage = (function() { + + /** + * Properties of a GroupInviteMessage. + * @memberof proto + * @interface IGroupInviteMessage + * @property {string|null} [groupJid] GroupInviteMessage groupJid + * @property {string|null} [inviteCode] GroupInviteMessage inviteCode + * @property {number|Long|null} [inviteExpiration] GroupInviteMessage inviteExpiration + * @property {string|null} [groupName] GroupInviteMessage groupName + * @property {Uint8Array|null} [jpegThumbnail] GroupInviteMessage jpegThumbnail + * @property {string|null} [caption] GroupInviteMessage caption + * @property {proto.IContextInfo|null} [contextInfo] GroupInviteMessage contextInfo + */ + + /** + * Constructs a new GroupInviteMessage. + * @memberof proto + * @classdesc Represents a GroupInviteMessage. + * @implements IGroupInviteMessage + * @constructor + * @param {proto.IGroupInviteMessage=} [properties] Properties to set + */ + function GroupInviteMessage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GroupInviteMessage groupJid. + * @member {string} groupJid + * @memberof proto.GroupInviteMessage + * @instance + */ + GroupInviteMessage.prototype.groupJid = ""; + + /** + * GroupInviteMessage inviteCode. + * @member {string} inviteCode + * @memberof proto.GroupInviteMessage + * @instance + */ + GroupInviteMessage.prototype.inviteCode = ""; + + /** + * GroupInviteMessage inviteExpiration. + * @member {number|Long} inviteExpiration + * @memberof proto.GroupInviteMessage + * @instance + */ + GroupInviteMessage.prototype.inviteExpiration = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * GroupInviteMessage groupName. + * @member {string} groupName + * @memberof proto.GroupInviteMessage + * @instance + */ + GroupInviteMessage.prototype.groupName = ""; + + /** + * GroupInviteMessage jpegThumbnail. + * @member {Uint8Array} jpegThumbnail + * @memberof proto.GroupInviteMessage + * @instance + */ + GroupInviteMessage.prototype.jpegThumbnail = $util.newBuffer([]); + + /** + * GroupInviteMessage caption. + * @member {string} caption + * @memberof proto.GroupInviteMessage + * @instance + */ + GroupInviteMessage.prototype.caption = ""; + + /** + * GroupInviteMessage contextInfo. + * @member {proto.IContextInfo|null|undefined} contextInfo + * @memberof proto.GroupInviteMessage + * @instance + */ + GroupInviteMessage.prototype.contextInfo = null; + + /** + * Creates a new GroupInviteMessage instance using the specified properties. + * @function create + * @memberof proto.GroupInviteMessage + * @static + * @param {proto.IGroupInviteMessage=} [properties] Properties to set + * @returns {proto.GroupInviteMessage} GroupInviteMessage instance + */ + GroupInviteMessage.create = function create(properties) { + return new GroupInviteMessage(properties); + }; + + /** + * Encodes the specified GroupInviteMessage message. Does not implicitly {@link proto.GroupInviteMessage.verify|verify} messages. + * @function encode + * @memberof proto.GroupInviteMessage + * @static + * @param {proto.IGroupInviteMessage} message GroupInviteMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupInviteMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.groupJid != null && Object.hasOwnProperty.call(message, "groupJid")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.groupJid); + if (message.inviteCode != null && Object.hasOwnProperty.call(message, "inviteCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inviteCode); + if (message.inviteExpiration != null && Object.hasOwnProperty.call(message, "inviteExpiration")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.inviteExpiration); + if (message.groupName != null && Object.hasOwnProperty.call(message, "groupName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.groupName); + if (message.jpegThumbnail != null && Object.hasOwnProperty.call(message, "jpegThumbnail")) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.jpegThumbnail); + if (message.caption != null && Object.hasOwnProperty.call(message, "caption")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.caption); + if (message.contextInfo != null && Object.hasOwnProperty.call(message, "contextInfo")) + $root.proto.ContextInfo.encode(message.contextInfo, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GroupInviteMessage message, length delimited. Does not implicitly {@link proto.GroupInviteMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.GroupInviteMessage + * @static + * @param {proto.IGroupInviteMessage} message GroupInviteMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupInviteMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupInviteMessage message from the specified reader or buffer. + * @function decode + * @memberof proto.GroupInviteMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.GroupInviteMessage} GroupInviteMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupInviteMessage.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.GroupInviteMessage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.groupJid = reader.string(); + break; + case 2: + message.inviteCode = reader.string(); + break; + case 3: + message.inviteExpiration = reader.int64(); + break; + case 4: + message.groupName = reader.string(); + break; + case 5: + message.jpegThumbnail = reader.bytes(); + break; + case 6: + message.caption = reader.string(); + break; + case 7: + message.contextInfo = $root.proto.ContextInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupInviteMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.GroupInviteMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.GroupInviteMessage} GroupInviteMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupInviteMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupInviteMessage message. + * @function verify + * @memberof proto.GroupInviteMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupInviteMessage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.groupJid != null && message.hasOwnProperty("groupJid")) + if (!$util.isString(message.groupJid)) + return "groupJid: string expected"; + if (message.inviteCode != null && message.hasOwnProperty("inviteCode")) + if (!$util.isString(message.inviteCode)) + return "inviteCode: string expected"; + if (message.inviteExpiration != null && message.hasOwnProperty("inviteExpiration")) + if (!$util.isInteger(message.inviteExpiration) && !(message.inviteExpiration && $util.isInteger(message.inviteExpiration.low) && $util.isInteger(message.inviteExpiration.high))) + return "inviteExpiration: integer|Long expected"; + if (message.groupName != null && message.hasOwnProperty("groupName")) + if (!$util.isString(message.groupName)) + return "groupName: string expected"; + if (message.jpegThumbnail != null && message.hasOwnProperty("jpegThumbnail")) + if (!(message.jpegThumbnail && typeof message.jpegThumbnail.length === "number" || $util.isString(message.jpegThumbnail))) + return "jpegThumbnail: buffer expected"; + if (message.caption != null && message.hasOwnProperty("caption")) + if (!$util.isString(message.caption)) + return "caption: string expected"; + if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) { + var error = $root.proto.ContextInfo.verify(message.contextInfo); + if (error) + return "contextInfo." + error; + } + return null; + }; + + /** + * Creates a GroupInviteMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.GroupInviteMessage + * @static + * @param {Object.} object Plain object + * @returns {proto.GroupInviteMessage} GroupInviteMessage + */ + GroupInviteMessage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.GroupInviteMessage) + return object; + var message = new $root.proto.GroupInviteMessage(); + if (object.groupJid != null) + message.groupJid = String(object.groupJid); + if (object.inviteCode != null) + message.inviteCode = String(object.inviteCode); + if (object.inviteExpiration != null) + if ($util.Long) + (message.inviteExpiration = $util.Long.fromValue(object.inviteExpiration)).unsigned = false; + else if (typeof object.inviteExpiration === "string") + message.inviteExpiration = parseInt(object.inviteExpiration, 10); + else if (typeof object.inviteExpiration === "number") + message.inviteExpiration = object.inviteExpiration; + else if (typeof object.inviteExpiration === "object") + message.inviteExpiration = new $util.LongBits(object.inviteExpiration.low >>> 0, object.inviteExpiration.high >>> 0).toNumber(); + if (object.groupName != null) + message.groupName = String(object.groupName); + if (object.jpegThumbnail != null) + if (typeof object.jpegThumbnail === "string") + $util.base64.decode(object.jpegThumbnail, message.jpegThumbnail = $util.newBuffer($util.base64.length(object.jpegThumbnail)), 0); + else if (object.jpegThumbnail.length) + message.jpegThumbnail = object.jpegThumbnail; + if (object.caption != null) + message.caption = String(object.caption); + if (object.contextInfo != null) { + if (typeof object.contextInfo !== "object") + throw TypeError(".proto.GroupInviteMessage.contextInfo: object expected"); + message.contextInfo = $root.proto.ContextInfo.fromObject(object.contextInfo); + } + return message; + }; + + /** + * Creates a plain object from a GroupInviteMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.GroupInviteMessage + * @static + * @param {proto.GroupInviteMessage} message GroupInviteMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupInviteMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.groupJid = ""; + object.inviteCode = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.inviteExpiration = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.inviteExpiration = options.longs === String ? "0" : 0; + object.groupName = ""; + if (options.bytes === String) + object.jpegThumbnail = ""; + else { + object.jpegThumbnail = []; + if (options.bytes !== Array) + object.jpegThumbnail = $util.newBuffer(object.jpegThumbnail); + } + object.caption = ""; + object.contextInfo = null; + } + if (message.groupJid != null && message.hasOwnProperty("groupJid")) + object.groupJid = message.groupJid; + if (message.inviteCode != null && message.hasOwnProperty("inviteCode")) + object.inviteCode = message.inviteCode; + if (message.inviteExpiration != null && message.hasOwnProperty("inviteExpiration")) + if (typeof message.inviteExpiration === "number") + object.inviteExpiration = options.longs === String ? String(message.inviteExpiration) : message.inviteExpiration; + else + object.inviteExpiration = options.longs === String ? $util.Long.prototype.toString.call(message.inviteExpiration) : options.longs === Number ? new $util.LongBits(message.inviteExpiration.low >>> 0, message.inviteExpiration.high >>> 0).toNumber() : message.inviteExpiration; + if (message.groupName != null && message.hasOwnProperty("groupName")) + object.groupName = message.groupName; + if (message.jpegThumbnail != null && message.hasOwnProperty("jpegThumbnail")) + object.jpegThumbnail = options.bytes === String ? $util.base64.encode(message.jpegThumbnail, 0, message.jpegThumbnail.length) : options.bytes === Array ? Array.prototype.slice.call(message.jpegThumbnail) : message.jpegThumbnail; + if (message.caption != null && message.hasOwnProperty("caption")) + object.caption = message.caption; + if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) + object.contextInfo = $root.proto.ContextInfo.toObject(message.contextInfo, options); + return object; + }; + + /** + * Converts this GroupInviteMessage to JSON. + * @function toJSON + * @memberof proto.GroupInviteMessage + * @instance + * @returns {Object.} JSON object + */ + GroupInviteMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GroupInviteMessage; + })(); + + proto.DeviceSentMessage = (function() { + + /** + * Properties of a DeviceSentMessage. + * @memberof proto + * @interface IDeviceSentMessage + * @property {string|null} [destinationJid] DeviceSentMessage destinationJid + * @property {proto.IMessage|null} [message] DeviceSentMessage message + */ + + /** + * Constructs a new DeviceSentMessage. + * @memberof proto + * @classdesc Represents a DeviceSentMessage. + * @implements IDeviceSentMessage + * @constructor + * @param {proto.IDeviceSentMessage=} [properties] Properties to set + */ + function DeviceSentMessage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeviceSentMessage destinationJid. + * @member {string} destinationJid + * @memberof proto.DeviceSentMessage + * @instance + */ + DeviceSentMessage.prototype.destinationJid = ""; + + /** + * DeviceSentMessage message. + * @member {proto.IMessage|null|undefined} message + * @memberof proto.DeviceSentMessage + * @instance + */ + DeviceSentMessage.prototype.message = null; + + /** + * Creates a new DeviceSentMessage instance using the specified properties. + * @function create + * @memberof proto.DeviceSentMessage + * @static + * @param {proto.IDeviceSentMessage=} [properties] Properties to set + * @returns {proto.DeviceSentMessage} DeviceSentMessage instance + */ + DeviceSentMessage.create = function create(properties) { + return new DeviceSentMessage(properties); + }; + + /** + * Encodes the specified DeviceSentMessage message. Does not implicitly {@link proto.DeviceSentMessage.verify|verify} messages. + * @function encode + * @memberof proto.DeviceSentMessage + * @static + * @param {proto.IDeviceSentMessage} message DeviceSentMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeviceSentMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.destinationJid != null && Object.hasOwnProperty.call(message, "destinationJid")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.destinationJid); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + $root.proto.Message.encode(message.message, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DeviceSentMessage message, length delimited. Does not implicitly {@link proto.DeviceSentMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.DeviceSentMessage + * @static + * @param {proto.IDeviceSentMessage} message DeviceSentMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeviceSentMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeviceSentMessage message from the specified reader or buffer. + * @function decode + * @memberof proto.DeviceSentMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.DeviceSentMessage} DeviceSentMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeviceSentMessage.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.DeviceSentMessage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.destinationJid = reader.string(); + break; + case 2: + message.message = $root.proto.Message.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeviceSentMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.DeviceSentMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.DeviceSentMessage} DeviceSentMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeviceSentMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeviceSentMessage message. + * @function verify + * @memberof proto.DeviceSentMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeviceSentMessage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.destinationJid != null && message.hasOwnProperty("destinationJid")) + if (!$util.isString(message.destinationJid)) + return "destinationJid: string expected"; + if (message.message != null && message.hasOwnProperty("message")) { + var error = $root.proto.Message.verify(message.message); + if (error) + return "message." + error; + } + return null; + }; + + /** + * Creates a DeviceSentMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.DeviceSentMessage + * @static + * @param {Object.} object Plain object + * @returns {proto.DeviceSentMessage} DeviceSentMessage + */ + DeviceSentMessage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.DeviceSentMessage) + return object; + var message = new $root.proto.DeviceSentMessage(); + if (object.destinationJid != null) + message.destinationJid = String(object.destinationJid); + if (object.message != null) { + if (typeof object.message !== "object") + throw TypeError(".proto.DeviceSentMessage.message: object expected"); + message.message = $root.proto.Message.fromObject(object.message); + } + return message; + }; + + /** + * Creates a plain object from a DeviceSentMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.DeviceSentMessage + * @static + * @param {proto.DeviceSentMessage} message DeviceSentMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeviceSentMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.destinationJid = ""; + object.message = null; + } + if (message.destinationJid != null && message.hasOwnProperty("destinationJid")) + object.destinationJid = message.destinationJid; + if (message.message != null && message.hasOwnProperty("message")) + object.message = $root.proto.Message.toObject(message.message, options); + return object; + }; + + /** + * Converts this DeviceSentMessage to JSON. + * @function toJSON + * @memberof proto.DeviceSentMessage + * @instance + * @returns {Object.} JSON object + */ + DeviceSentMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeviceSentMessage; + })(); + + proto.DeviceSyncMessage = (function() { + + /** + * Properties of a DeviceSyncMessage. + * @memberof proto + * @interface IDeviceSyncMessage + * @property {Uint8Array|null} [serializedXmlBytes] DeviceSyncMessage serializedXmlBytes + */ + + /** + * Constructs a new DeviceSyncMessage. + * @memberof proto + * @classdesc Represents a DeviceSyncMessage. + * @implements IDeviceSyncMessage + * @constructor + * @param {proto.IDeviceSyncMessage=} [properties] Properties to set + */ + function DeviceSyncMessage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeviceSyncMessage serializedXmlBytes. + * @member {Uint8Array} serializedXmlBytes + * @memberof proto.DeviceSyncMessage + * @instance + */ + DeviceSyncMessage.prototype.serializedXmlBytes = $util.newBuffer([]); + + /** + * Creates a new DeviceSyncMessage instance using the specified properties. + * @function create + * @memberof proto.DeviceSyncMessage + * @static + * @param {proto.IDeviceSyncMessage=} [properties] Properties to set + * @returns {proto.DeviceSyncMessage} DeviceSyncMessage instance + */ + DeviceSyncMessage.create = function create(properties) { + return new DeviceSyncMessage(properties); + }; + + /** + * Encodes the specified DeviceSyncMessage message. Does not implicitly {@link proto.DeviceSyncMessage.verify|verify} messages. + * @function encode + * @memberof proto.DeviceSyncMessage + * @static + * @param {proto.IDeviceSyncMessage} message DeviceSyncMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeviceSyncMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.serializedXmlBytes != null && Object.hasOwnProperty.call(message, "serializedXmlBytes")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.serializedXmlBytes); + return writer; + }; + + /** + * Encodes the specified DeviceSyncMessage message, length delimited. Does not implicitly {@link proto.DeviceSyncMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.DeviceSyncMessage + * @static + * @param {proto.IDeviceSyncMessage} message DeviceSyncMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeviceSyncMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeviceSyncMessage message from the specified reader or buffer. + * @function decode + * @memberof proto.DeviceSyncMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.DeviceSyncMessage} DeviceSyncMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeviceSyncMessage.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.DeviceSyncMessage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.serializedXmlBytes = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeviceSyncMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.DeviceSyncMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.DeviceSyncMessage} DeviceSyncMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeviceSyncMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeviceSyncMessage message. + * @function verify + * @memberof proto.DeviceSyncMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeviceSyncMessage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.serializedXmlBytes != null && message.hasOwnProperty("serializedXmlBytes")) + if (!(message.serializedXmlBytes && typeof message.serializedXmlBytes.length === "number" || $util.isString(message.serializedXmlBytes))) + return "serializedXmlBytes: buffer expected"; + return null; + }; + + /** + * Creates a DeviceSyncMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.DeviceSyncMessage + * @static + * @param {Object.} object Plain object + * @returns {proto.DeviceSyncMessage} DeviceSyncMessage + */ + DeviceSyncMessage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.DeviceSyncMessage) + return object; + var message = new $root.proto.DeviceSyncMessage(); + if (object.serializedXmlBytes != null) + if (typeof object.serializedXmlBytes === "string") + $util.base64.decode(object.serializedXmlBytes, message.serializedXmlBytes = $util.newBuffer($util.base64.length(object.serializedXmlBytes)), 0); + else if (object.serializedXmlBytes.length) + message.serializedXmlBytes = object.serializedXmlBytes; + return message; + }; + + /** + * Creates a plain object from a DeviceSyncMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.DeviceSyncMessage + * @static + * @param {proto.DeviceSyncMessage} message DeviceSyncMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeviceSyncMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.serializedXmlBytes = ""; + else { + object.serializedXmlBytes = []; + if (options.bytes !== Array) + object.serializedXmlBytes = $util.newBuffer(object.serializedXmlBytes); + } + if (message.serializedXmlBytes != null && message.hasOwnProperty("serializedXmlBytes")) + object.serializedXmlBytes = options.bytes === String ? $util.base64.encode(message.serializedXmlBytes, 0, message.serializedXmlBytes.length) : options.bytes === Array ? Array.prototype.slice.call(message.serializedXmlBytes) : message.serializedXmlBytes; + return object; + }; + + /** + * Converts this DeviceSyncMessage to JSON. + * @function toJSON + * @memberof proto.DeviceSyncMessage + * @instance + * @returns {Object.} JSON object + */ + DeviceSyncMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeviceSyncMessage; + })(); + + proto.Message = (function() { + + /** + * Properties of a Message. + * @memberof proto + * @interface IMessage + * @property {string|null} [conversation] Message conversation + * @property {proto.ISenderKeyDistributionMessage|null} [senderKeyDistributionMessage] Message senderKeyDistributionMessage + * @property {proto.IImageMessage|null} [imageMessage] Message imageMessage + * @property {proto.IContactMessage|null} [contactMessage] Message contactMessage + * @property {proto.ILocationMessage|null} [locationMessage] Message locationMessage + * @property {proto.IExtendedTextMessage|null} [extendedTextMessage] Message extendedTextMessage + * @property {proto.IDocumentMessage|null} [documentMessage] Message documentMessage + * @property {proto.IAudioMessage|null} [audioMessage] Message audioMessage + * @property {proto.IVideoMessage|null} [videoMessage] Message videoMessage + * @property {proto.ICall|null} [call] Message call + * @property {proto.IChat|null} [chat] Message chat + * @property {proto.IProtocolMessage|null} [protocolMessage] Message protocolMessage + * @property {proto.IContactsArrayMessage|null} [contactsArrayMessage] Message contactsArrayMessage + * @property {proto.IHighlyStructuredMessage|null} [highlyStructuredMessage] Message highlyStructuredMessage + * @property {proto.ISenderKeyDistributionMessage|null} [fastRatchetKeySenderKeyDistributionMessage] Message fastRatchetKeySenderKeyDistributionMessage + * @property {proto.ISendPaymentMessage|null} [sendPaymentMessage] Message sendPaymentMessage + * @property {proto.ILiveLocationMessage|null} [liveLocationMessage] Message liveLocationMessage + * @property {proto.IRequestPaymentMessage|null} [requestPaymentMessage] Message requestPaymentMessage + * @property {proto.IDeclinePaymentRequestMessage|null} [declinePaymentRequestMessage] Message declinePaymentRequestMessage + * @property {proto.ICancelPaymentRequestMessage|null} [cancelPaymentRequestMessage] Message cancelPaymentRequestMessage + * @property {proto.ITemplateMessage|null} [templateMessage] Message templateMessage + * @property {proto.IStickerMessage|null} [stickerMessage] Message stickerMessage + * @property {proto.IGroupInviteMessage|null} [groupInviteMessage] Message groupInviteMessage + * @property {proto.ITemplateButtonReplyMessage|null} [templateButtonReplyMessage] Message templateButtonReplyMessage + * @property {proto.IProductMessage|null} [productMessage] Message productMessage + * @property {proto.IDeviceSentMessage|null} [deviceSentMessage] Message deviceSentMessage + * @property {proto.IDeviceSyncMessage|null} [deviceSyncMessage] Message deviceSyncMessage + */ + + /** + * Constructs a new Message. + * @memberof proto + * @classdesc Represents a Message. + * @implements IMessage + * @constructor + * @param {proto.IMessage=} [properties] Properties to set + */ + function Message(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Message conversation. + * @member {string} conversation + * @memberof proto.Message + * @instance + */ + Message.prototype.conversation = ""; + + /** + * Message senderKeyDistributionMessage. + * @member {proto.ISenderKeyDistributionMessage|null|undefined} senderKeyDistributionMessage + * @memberof proto.Message + * @instance + */ + Message.prototype.senderKeyDistributionMessage = null; + + /** + * Message imageMessage. + * @member {proto.IImageMessage|null|undefined} imageMessage + * @memberof proto.Message + * @instance + */ + Message.prototype.imageMessage = null; + + /** + * Message contactMessage. + * @member {proto.IContactMessage|null|undefined} contactMessage + * @memberof proto.Message + * @instance + */ + Message.prototype.contactMessage = null; + + /** + * Message locationMessage. + * @member {proto.ILocationMessage|null|undefined} locationMessage + * @memberof proto.Message + * @instance + */ + Message.prototype.locationMessage = null; + + /** + * Message extendedTextMessage. + * @member {proto.IExtendedTextMessage|null|undefined} extendedTextMessage + * @memberof proto.Message + * @instance + */ + Message.prototype.extendedTextMessage = null; + + /** + * Message documentMessage. + * @member {proto.IDocumentMessage|null|undefined} documentMessage + * @memberof proto.Message + * @instance + */ + Message.prototype.documentMessage = null; + + /** + * Message audioMessage. + * @member {proto.IAudioMessage|null|undefined} audioMessage + * @memberof proto.Message + * @instance + */ + Message.prototype.audioMessage = null; + + /** + * Message videoMessage. + * @member {proto.IVideoMessage|null|undefined} videoMessage + * @memberof proto.Message + * @instance + */ + Message.prototype.videoMessage = null; + + /** + * Message call. + * @member {proto.ICall|null|undefined} call + * @memberof proto.Message + * @instance + */ + Message.prototype.call = null; + + /** + * Message chat. + * @member {proto.IChat|null|undefined} chat + * @memberof proto.Message + * @instance + */ + Message.prototype.chat = null; + + /** + * Message protocolMessage. + * @member {proto.IProtocolMessage|null|undefined} protocolMessage + * @memberof proto.Message + * @instance + */ + Message.prototype.protocolMessage = null; + + /** + * Message contactsArrayMessage. + * @member {proto.IContactsArrayMessage|null|undefined} contactsArrayMessage + * @memberof proto.Message + * @instance + */ + Message.prototype.contactsArrayMessage = null; + + /** + * Message highlyStructuredMessage. + * @member {proto.IHighlyStructuredMessage|null|undefined} highlyStructuredMessage + * @memberof proto.Message + * @instance + */ + Message.prototype.highlyStructuredMessage = null; + + /** + * Message fastRatchetKeySenderKeyDistributionMessage. + * @member {proto.ISenderKeyDistributionMessage|null|undefined} fastRatchetKeySenderKeyDistributionMessage + * @memberof proto.Message + * @instance + */ + Message.prototype.fastRatchetKeySenderKeyDistributionMessage = null; + + /** + * Message sendPaymentMessage. + * @member {proto.ISendPaymentMessage|null|undefined} sendPaymentMessage + * @memberof proto.Message + * @instance + */ + Message.prototype.sendPaymentMessage = null; + + /** + * Message liveLocationMessage. + * @member {proto.ILiveLocationMessage|null|undefined} liveLocationMessage + * @memberof proto.Message + * @instance + */ + Message.prototype.liveLocationMessage = null; + + /** + * Message requestPaymentMessage. + * @member {proto.IRequestPaymentMessage|null|undefined} requestPaymentMessage + * @memberof proto.Message + * @instance + */ + Message.prototype.requestPaymentMessage = null; + + /** + * Message declinePaymentRequestMessage. + * @member {proto.IDeclinePaymentRequestMessage|null|undefined} declinePaymentRequestMessage + * @memberof proto.Message + * @instance + */ + Message.prototype.declinePaymentRequestMessage = null; + + /** + * Message cancelPaymentRequestMessage. + * @member {proto.ICancelPaymentRequestMessage|null|undefined} cancelPaymentRequestMessage + * @memberof proto.Message + * @instance + */ + Message.prototype.cancelPaymentRequestMessage = null; + + /** + * Message templateMessage. + * @member {proto.ITemplateMessage|null|undefined} templateMessage + * @memberof proto.Message + * @instance + */ + Message.prototype.templateMessage = null; + + /** + * Message stickerMessage. + * @member {proto.IStickerMessage|null|undefined} stickerMessage + * @memberof proto.Message + * @instance + */ + Message.prototype.stickerMessage = null; + + /** + * Message groupInviteMessage. + * @member {proto.IGroupInviteMessage|null|undefined} groupInviteMessage + * @memberof proto.Message + * @instance + */ + Message.prototype.groupInviteMessage = null; + + /** + * Message templateButtonReplyMessage. + * @member {proto.ITemplateButtonReplyMessage|null|undefined} templateButtonReplyMessage + * @memberof proto.Message + * @instance + */ + Message.prototype.templateButtonReplyMessage = null; + + /** + * Message productMessage. + * @member {proto.IProductMessage|null|undefined} productMessage + * @memberof proto.Message + * @instance + */ + Message.prototype.productMessage = null; + + /** + * Message deviceSentMessage. + * @member {proto.IDeviceSentMessage|null|undefined} deviceSentMessage + * @memberof proto.Message + * @instance + */ + Message.prototype.deviceSentMessage = null; + + /** + * Message deviceSyncMessage. + * @member {proto.IDeviceSyncMessage|null|undefined} deviceSyncMessage + * @memberof proto.Message + * @instance + */ + Message.prototype.deviceSyncMessage = null; + + /** + * Creates a new Message instance using the specified properties. + * @function create + * @memberof proto.Message + * @static + * @param {proto.IMessage=} [properties] Properties to set + * @returns {proto.Message} Message instance + */ + Message.create = function create(properties) { + return new Message(properties); + }; + + /** + * Encodes the specified Message message. Does not implicitly {@link proto.Message.verify|verify} messages. + * @function encode + * @memberof proto.Message + * @static + * @param {proto.IMessage} message Message message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Message.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.conversation != null && Object.hasOwnProperty.call(message, "conversation")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.conversation); + if (message.senderKeyDistributionMessage != null && Object.hasOwnProperty.call(message, "senderKeyDistributionMessage")) + $root.proto.SenderKeyDistributionMessage.encode(message.senderKeyDistributionMessage, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.imageMessage != null && Object.hasOwnProperty.call(message, "imageMessage")) + $root.proto.ImageMessage.encode(message.imageMessage, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.contactMessage != null && Object.hasOwnProperty.call(message, "contactMessage")) + $root.proto.ContactMessage.encode(message.contactMessage, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.locationMessage != null && Object.hasOwnProperty.call(message, "locationMessage")) + $root.proto.LocationMessage.encode(message.locationMessage, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.extendedTextMessage != null && Object.hasOwnProperty.call(message, "extendedTextMessage")) + $root.proto.ExtendedTextMessage.encode(message.extendedTextMessage, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.documentMessage != null && Object.hasOwnProperty.call(message, "documentMessage")) + $root.proto.DocumentMessage.encode(message.documentMessage, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.audioMessage != null && Object.hasOwnProperty.call(message, "audioMessage")) + $root.proto.AudioMessage.encode(message.audioMessage, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.videoMessage != null && Object.hasOwnProperty.call(message, "videoMessage")) + $root.proto.VideoMessage.encode(message.videoMessage, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.call != null && Object.hasOwnProperty.call(message, "call")) + $root.proto.Call.encode(message.call, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.chat != null && Object.hasOwnProperty.call(message, "chat")) + $root.proto.Chat.encode(message.chat, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.protocolMessage != null && Object.hasOwnProperty.call(message, "protocolMessage")) + $root.proto.ProtocolMessage.encode(message.protocolMessage, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.contactsArrayMessage != null && Object.hasOwnProperty.call(message, "contactsArrayMessage")) + $root.proto.ContactsArrayMessage.encode(message.contactsArrayMessage, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.highlyStructuredMessage != null && Object.hasOwnProperty.call(message, "highlyStructuredMessage")) + $root.proto.HighlyStructuredMessage.encode(message.highlyStructuredMessage, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.fastRatchetKeySenderKeyDistributionMessage != null && Object.hasOwnProperty.call(message, "fastRatchetKeySenderKeyDistributionMessage")) + $root.proto.SenderKeyDistributionMessage.encode(message.fastRatchetKeySenderKeyDistributionMessage, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.sendPaymentMessage != null && Object.hasOwnProperty.call(message, "sendPaymentMessage")) + $root.proto.SendPaymentMessage.encode(message.sendPaymentMessage, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.liveLocationMessage != null && Object.hasOwnProperty.call(message, "liveLocationMessage")) + $root.proto.LiveLocationMessage.encode(message.liveLocationMessage, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.requestPaymentMessage != null && Object.hasOwnProperty.call(message, "requestPaymentMessage")) + $root.proto.RequestPaymentMessage.encode(message.requestPaymentMessage, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.declinePaymentRequestMessage != null && Object.hasOwnProperty.call(message, "declinePaymentRequestMessage")) + $root.proto.DeclinePaymentRequestMessage.encode(message.declinePaymentRequestMessage, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.cancelPaymentRequestMessage != null && Object.hasOwnProperty.call(message, "cancelPaymentRequestMessage")) + $root.proto.CancelPaymentRequestMessage.encode(message.cancelPaymentRequestMessage, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.templateMessage != null && Object.hasOwnProperty.call(message, "templateMessage")) + $root.proto.TemplateMessage.encode(message.templateMessage, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.stickerMessage != null && Object.hasOwnProperty.call(message, "stickerMessage")) + $root.proto.StickerMessage.encode(message.stickerMessage, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.groupInviteMessage != null && Object.hasOwnProperty.call(message, "groupInviteMessage")) + $root.proto.GroupInviteMessage.encode(message.groupInviteMessage, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + if (message.templateButtonReplyMessage != null && Object.hasOwnProperty.call(message, "templateButtonReplyMessage")) + $root.proto.TemplateButtonReplyMessage.encode(message.templateButtonReplyMessage, writer.uint32(/* id 29, wireType 2 =*/234).fork()).ldelim(); + if (message.productMessage != null && Object.hasOwnProperty.call(message, "productMessage")) + $root.proto.ProductMessage.encode(message.productMessage, writer.uint32(/* id 30, wireType 2 =*/242).fork()).ldelim(); + if (message.deviceSentMessage != null && Object.hasOwnProperty.call(message, "deviceSentMessage")) + $root.proto.DeviceSentMessage.encode(message.deviceSentMessage, writer.uint32(/* id 31, wireType 2 =*/250).fork()).ldelim(); + if (message.deviceSyncMessage != null && Object.hasOwnProperty.call(message, "deviceSyncMessage")) + $root.proto.DeviceSyncMessage.encode(message.deviceSyncMessage, writer.uint32(/* id 32, wireType 2 =*/258).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Message message, length delimited. Does not implicitly {@link proto.Message.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.Message + * @static + * @param {proto.IMessage} message Message message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Message.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Message message from the specified reader or buffer. + * @function decode + * @memberof proto.Message + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.Message} Message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Message.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.Message(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.conversation = reader.string(); + break; + case 2: + message.senderKeyDistributionMessage = $root.proto.SenderKeyDistributionMessage.decode(reader, reader.uint32()); + break; + case 3: + message.imageMessage = $root.proto.ImageMessage.decode(reader, reader.uint32()); + break; + case 4: + message.contactMessage = $root.proto.ContactMessage.decode(reader, reader.uint32()); + break; + case 5: + message.locationMessage = $root.proto.LocationMessage.decode(reader, reader.uint32()); + break; + case 6: + message.extendedTextMessage = $root.proto.ExtendedTextMessage.decode(reader, reader.uint32()); + break; + case 7: + message.documentMessage = $root.proto.DocumentMessage.decode(reader, reader.uint32()); + break; + case 8: + message.audioMessage = $root.proto.AudioMessage.decode(reader, reader.uint32()); + break; + case 9: + message.videoMessage = $root.proto.VideoMessage.decode(reader, reader.uint32()); + break; + case 10: + message.call = $root.proto.Call.decode(reader, reader.uint32()); + break; + case 11: + message.chat = $root.proto.Chat.decode(reader, reader.uint32()); + break; + case 12: + message.protocolMessage = $root.proto.ProtocolMessage.decode(reader, reader.uint32()); + break; + case 13: + message.contactsArrayMessage = $root.proto.ContactsArrayMessage.decode(reader, reader.uint32()); + break; + case 14: + message.highlyStructuredMessage = $root.proto.HighlyStructuredMessage.decode(reader, reader.uint32()); + break; + case 15: + message.fastRatchetKeySenderKeyDistributionMessage = $root.proto.SenderKeyDistributionMessage.decode(reader, reader.uint32()); + break; + case 16: + message.sendPaymentMessage = $root.proto.SendPaymentMessage.decode(reader, reader.uint32()); + break; + case 18: + message.liveLocationMessage = $root.proto.LiveLocationMessage.decode(reader, reader.uint32()); + break; + case 22: + message.requestPaymentMessage = $root.proto.RequestPaymentMessage.decode(reader, reader.uint32()); + break; + case 23: + message.declinePaymentRequestMessage = $root.proto.DeclinePaymentRequestMessage.decode(reader, reader.uint32()); + break; + case 24: + message.cancelPaymentRequestMessage = $root.proto.CancelPaymentRequestMessage.decode(reader, reader.uint32()); + break; + case 25: + message.templateMessage = $root.proto.TemplateMessage.decode(reader, reader.uint32()); + break; + case 26: + message.stickerMessage = $root.proto.StickerMessage.decode(reader, reader.uint32()); + break; + case 28: + message.groupInviteMessage = $root.proto.GroupInviteMessage.decode(reader, reader.uint32()); + break; + case 29: + message.templateButtonReplyMessage = $root.proto.TemplateButtonReplyMessage.decode(reader, reader.uint32()); + break; + case 30: + message.productMessage = $root.proto.ProductMessage.decode(reader, reader.uint32()); + break; + case 31: + message.deviceSentMessage = $root.proto.DeviceSentMessage.decode(reader, reader.uint32()); + break; + case 32: + message.deviceSyncMessage = $root.proto.DeviceSyncMessage.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Message message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.Message + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.Message} Message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Message.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Message message. + * @function verify + * @memberof proto.Message + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Message.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.conversation != null && message.hasOwnProperty("conversation")) + if (!$util.isString(message.conversation)) + return "conversation: string expected"; + if (message.senderKeyDistributionMessage != null && message.hasOwnProperty("senderKeyDistributionMessage")) { + var error = $root.proto.SenderKeyDistributionMessage.verify(message.senderKeyDistributionMessage); + if (error) + return "senderKeyDistributionMessage." + error; + } + if (message.imageMessage != null && message.hasOwnProperty("imageMessage")) { + var error = $root.proto.ImageMessage.verify(message.imageMessage); + if (error) + return "imageMessage." + error; + } + if (message.contactMessage != null && message.hasOwnProperty("contactMessage")) { + var error = $root.proto.ContactMessage.verify(message.contactMessage); + if (error) + return "contactMessage." + error; + } + if (message.locationMessage != null && message.hasOwnProperty("locationMessage")) { + var error = $root.proto.LocationMessage.verify(message.locationMessage); + if (error) + return "locationMessage." + error; + } + if (message.extendedTextMessage != null && message.hasOwnProperty("extendedTextMessage")) { + var error = $root.proto.ExtendedTextMessage.verify(message.extendedTextMessage); + if (error) + return "extendedTextMessage." + error; + } + if (message.documentMessage != null && message.hasOwnProperty("documentMessage")) { + var error = $root.proto.DocumentMessage.verify(message.documentMessage); + if (error) + return "documentMessage." + error; + } + if (message.audioMessage != null && message.hasOwnProperty("audioMessage")) { + var error = $root.proto.AudioMessage.verify(message.audioMessage); + if (error) + return "audioMessage." + error; + } + if (message.videoMessage != null && message.hasOwnProperty("videoMessage")) { + var error = $root.proto.VideoMessage.verify(message.videoMessage); + if (error) + return "videoMessage." + error; + } + if (message.call != null && message.hasOwnProperty("call")) { + var error = $root.proto.Call.verify(message.call); + if (error) + return "call." + error; + } + if (message.chat != null && message.hasOwnProperty("chat")) { + var error = $root.proto.Chat.verify(message.chat); + if (error) + return "chat." + error; + } + if (message.protocolMessage != null && message.hasOwnProperty("protocolMessage")) { + var error = $root.proto.ProtocolMessage.verify(message.protocolMessage); + if (error) + return "protocolMessage." + error; + } + if (message.contactsArrayMessage != null && message.hasOwnProperty("contactsArrayMessage")) { + var error = $root.proto.ContactsArrayMessage.verify(message.contactsArrayMessage); + if (error) + return "contactsArrayMessage." + error; + } + if (message.highlyStructuredMessage != null && message.hasOwnProperty("highlyStructuredMessage")) { + var error = $root.proto.HighlyStructuredMessage.verify(message.highlyStructuredMessage); + if (error) + return "highlyStructuredMessage." + error; + } + if (message.fastRatchetKeySenderKeyDistributionMessage != null && message.hasOwnProperty("fastRatchetKeySenderKeyDistributionMessage")) { + var error = $root.proto.SenderKeyDistributionMessage.verify(message.fastRatchetKeySenderKeyDistributionMessage); + if (error) + return "fastRatchetKeySenderKeyDistributionMessage." + error; + } + if (message.sendPaymentMessage != null && message.hasOwnProperty("sendPaymentMessage")) { + var error = $root.proto.SendPaymentMessage.verify(message.sendPaymentMessage); + if (error) + return "sendPaymentMessage." + error; + } + if (message.liveLocationMessage != null && message.hasOwnProperty("liveLocationMessage")) { + var error = $root.proto.LiveLocationMessage.verify(message.liveLocationMessage); + if (error) + return "liveLocationMessage." + error; + } + if (message.requestPaymentMessage != null && message.hasOwnProperty("requestPaymentMessage")) { + var error = $root.proto.RequestPaymentMessage.verify(message.requestPaymentMessage); + if (error) + return "requestPaymentMessage." + error; + } + if (message.declinePaymentRequestMessage != null && message.hasOwnProperty("declinePaymentRequestMessage")) { + var error = $root.proto.DeclinePaymentRequestMessage.verify(message.declinePaymentRequestMessage); + if (error) + return "declinePaymentRequestMessage." + error; + } + if (message.cancelPaymentRequestMessage != null && message.hasOwnProperty("cancelPaymentRequestMessage")) { + var error = $root.proto.CancelPaymentRequestMessage.verify(message.cancelPaymentRequestMessage); + if (error) + return "cancelPaymentRequestMessage." + error; + } + if (message.templateMessage != null && message.hasOwnProperty("templateMessage")) { + var error = $root.proto.TemplateMessage.verify(message.templateMessage); + if (error) + return "templateMessage." + error; + } + if (message.stickerMessage != null && message.hasOwnProperty("stickerMessage")) { + var error = $root.proto.StickerMessage.verify(message.stickerMessage); + if (error) + return "stickerMessage." + error; + } + if (message.groupInviteMessage != null && message.hasOwnProperty("groupInviteMessage")) { + var error = $root.proto.GroupInviteMessage.verify(message.groupInviteMessage); + if (error) + return "groupInviteMessage." + error; + } + if (message.templateButtonReplyMessage != null && message.hasOwnProperty("templateButtonReplyMessage")) { + var error = $root.proto.TemplateButtonReplyMessage.verify(message.templateButtonReplyMessage); + if (error) + return "templateButtonReplyMessage." + error; + } + if (message.productMessage != null && message.hasOwnProperty("productMessage")) { + var error = $root.proto.ProductMessage.verify(message.productMessage); + if (error) + return "productMessage." + error; + } + if (message.deviceSentMessage != null && message.hasOwnProperty("deviceSentMessage")) { + var error = $root.proto.DeviceSentMessage.verify(message.deviceSentMessage); + if (error) + return "deviceSentMessage." + error; + } + if (message.deviceSyncMessage != null && message.hasOwnProperty("deviceSyncMessage")) { + var error = $root.proto.DeviceSyncMessage.verify(message.deviceSyncMessage); + if (error) + return "deviceSyncMessage." + error; + } + return null; + }; + + /** + * Creates a Message message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.Message + * @static + * @param {Object.} object Plain object + * @returns {proto.Message} Message + */ + Message.fromObject = function fromObject(object) { + if (object instanceof $root.proto.Message) + return object; + var message = new $root.proto.Message(); + if (object.conversation != null) + message.conversation = String(object.conversation); + if (object.senderKeyDistributionMessage != null) { + if (typeof object.senderKeyDistributionMessage !== "object") + throw TypeError(".proto.Message.senderKeyDistributionMessage: object expected"); + message.senderKeyDistributionMessage = $root.proto.SenderKeyDistributionMessage.fromObject(object.senderKeyDistributionMessage); + } + if (object.imageMessage != null) { + if (typeof object.imageMessage !== "object") + throw TypeError(".proto.Message.imageMessage: object expected"); + message.imageMessage = $root.proto.ImageMessage.fromObject(object.imageMessage); + } + if (object.contactMessage != null) { + if (typeof object.contactMessage !== "object") + throw TypeError(".proto.Message.contactMessage: object expected"); + message.contactMessage = $root.proto.ContactMessage.fromObject(object.contactMessage); + } + if (object.locationMessage != null) { + if (typeof object.locationMessage !== "object") + throw TypeError(".proto.Message.locationMessage: object expected"); + message.locationMessage = $root.proto.LocationMessage.fromObject(object.locationMessage); + } + if (object.extendedTextMessage != null) { + if (typeof object.extendedTextMessage !== "object") + throw TypeError(".proto.Message.extendedTextMessage: object expected"); + message.extendedTextMessage = $root.proto.ExtendedTextMessage.fromObject(object.extendedTextMessage); + } + if (object.documentMessage != null) { + if (typeof object.documentMessage !== "object") + throw TypeError(".proto.Message.documentMessage: object expected"); + message.documentMessage = $root.proto.DocumentMessage.fromObject(object.documentMessage); + } + if (object.audioMessage != null) { + if (typeof object.audioMessage !== "object") + throw TypeError(".proto.Message.audioMessage: object expected"); + message.audioMessage = $root.proto.AudioMessage.fromObject(object.audioMessage); + } + if (object.videoMessage != null) { + if (typeof object.videoMessage !== "object") + throw TypeError(".proto.Message.videoMessage: object expected"); + message.videoMessage = $root.proto.VideoMessage.fromObject(object.videoMessage); + } + if (object.call != null) { + if (typeof object.call !== "object") + throw TypeError(".proto.Message.call: object expected"); + message.call = $root.proto.Call.fromObject(object.call); + } + if (object.chat != null) { + if (typeof object.chat !== "object") + throw TypeError(".proto.Message.chat: object expected"); + message.chat = $root.proto.Chat.fromObject(object.chat); + } + if (object.protocolMessage != null) { + if (typeof object.protocolMessage !== "object") + throw TypeError(".proto.Message.protocolMessage: object expected"); + message.protocolMessage = $root.proto.ProtocolMessage.fromObject(object.protocolMessage); + } + if (object.contactsArrayMessage != null) { + if (typeof object.contactsArrayMessage !== "object") + throw TypeError(".proto.Message.contactsArrayMessage: object expected"); + message.contactsArrayMessage = $root.proto.ContactsArrayMessage.fromObject(object.contactsArrayMessage); + } + if (object.highlyStructuredMessage != null) { + if (typeof object.highlyStructuredMessage !== "object") + throw TypeError(".proto.Message.highlyStructuredMessage: object expected"); + message.highlyStructuredMessage = $root.proto.HighlyStructuredMessage.fromObject(object.highlyStructuredMessage); + } + if (object.fastRatchetKeySenderKeyDistributionMessage != null) { + if (typeof object.fastRatchetKeySenderKeyDistributionMessage !== "object") + throw TypeError(".proto.Message.fastRatchetKeySenderKeyDistributionMessage: object expected"); + message.fastRatchetKeySenderKeyDistributionMessage = $root.proto.SenderKeyDistributionMessage.fromObject(object.fastRatchetKeySenderKeyDistributionMessage); + } + if (object.sendPaymentMessage != null) { + if (typeof object.sendPaymentMessage !== "object") + throw TypeError(".proto.Message.sendPaymentMessage: object expected"); + message.sendPaymentMessage = $root.proto.SendPaymentMessage.fromObject(object.sendPaymentMessage); + } + if (object.liveLocationMessage != null) { + if (typeof object.liveLocationMessage !== "object") + throw TypeError(".proto.Message.liveLocationMessage: object expected"); + message.liveLocationMessage = $root.proto.LiveLocationMessage.fromObject(object.liveLocationMessage); + } + if (object.requestPaymentMessage != null) { + if (typeof object.requestPaymentMessage !== "object") + throw TypeError(".proto.Message.requestPaymentMessage: object expected"); + message.requestPaymentMessage = $root.proto.RequestPaymentMessage.fromObject(object.requestPaymentMessage); + } + if (object.declinePaymentRequestMessage != null) { + if (typeof object.declinePaymentRequestMessage !== "object") + throw TypeError(".proto.Message.declinePaymentRequestMessage: object expected"); + message.declinePaymentRequestMessage = $root.proto.DeclinePaymentRequestMessage.fromObject(object.declinePaymentRequestMessage); + } + if (object.cancelPaymentRequestMessage != null) { + if (typeof object.cancelPaymentRequestMessage !== "object") + throw TypeError(".proto.Message.cancelPaymentRequestMessage: object expected"); + message.cancelPaymentRequestMessage = $root.proto.CancelPaymentRequestMessage.fromObject(object.cancelPaymentRequestMessage); + } + if (object.templateMessage != null) { + if (typeof object.templateMessage !== "object") + throw TypeError(".proto.Message.templateMessage: object expected"); + message.templateMessage = $root.proto.TemplateMessage.fromObject(object.templateMessage); + } + if (object.stickerMessage != null) { + if (typeof object.stickerMessage !== "object") + throw TypeError(".proto.Message.stickerMessage: object expected"); + message.stickerMessage = $root.proto.StickerMessage.fromObject(object.stickerMessage); + } + if (object.groupInviteMessage != null) { + if (typeof object.groupInviteMessage !== "object") + throw TypeError(".proto.Message.groupInviteMessage: object expected"); + message.groupInviteMessage = $root.proto.GroupInviteMessage.fromObject(object.groupInviteMessage); + } + if (object.templateButtonReplyMessage != null) { + if (typeof object.templateButtonReplyMessage !== "object") + throw TypeError(".proto.Message.templateButtonReplyMessage: object expected"); + message.templateButtonReplyMessage = $root.proto.TemplateButtonReplyMessage.fromObject(object.templateButtonReplyMessage); + } + if (object.productMessage != null) { + if (typeof object.productMessage !== "object") + throw TypeError(".proto.Message.productMessage: object expected"); + message.productMessage = $root.proto.ProductMessage.fromObject(object.productMessage); + } + if (object.deviceSentMessage != null) { + if (typeof object.deviceSentMessage !== "object") + throw TypeError(".proto.Message.deviceSentMessage: object expected"); + message.deviceSentMessage = $root.proto.DeviceSentMessage.fromObject(object.deviceSentMessage); + } + if (object.deviceSyncMessage != null) { + if (typeof object.deviceSyncMessage !== "object") + throw TypeError(".proto.Message.deviceSyncMessage: object expected"); + message.deviceSyncMessage = $root.proto.DeviceSyncMessage.fromObject(object.deviceSyncMessage); + } + return message; + }; + + /** + * Creates a plain object from a Message message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.Message + * @static + * @param {proto.Message} message Message + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Message.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.conversation = ""; + object.senderKeyDistributionMessage = null; + object.imageMessage = null; + object.contactMessage = null; + object.locationMessage = null; + object.extendedTextMessage = null; + object.documentMessage = null; + object.audioMessage = null; + object.videoMessage = null; + object.call = null; + object.chat = null; + object.protocolMessage = null; + object.contactsArrayMessage = null; + object.highlyStructuredMessage = null; + object.fastRatchetKeySenderKeyDistributionMessage = null; + object.sendPaymentMessage = null; + object.liveLocationMessage = null; + object.requestPaymentMessage = null; + object.declinePaymentRequestMessage = null; + object.cancelPaymentRequestMessage = null; + object.templateMessage = null; + object.stickerMessage = null; + object.groupInviteMessage = null; + object.templateButtonReplyMessage = null; + object.productMessage = null; + object.deviceSentMessage = null; + object.deviceSyncMessage = null; + } + if (message.conversation != null && message.hasOwnProperty("conversation")) + object.conversation = message.conversation; + if (message.senderKeyDistributionMessage != null && message.hasOwnProperty("senderKeyDistributionMessage")) + object.senderKeyDistributionMessage = $root.proto.SenderKeyDistributionMessage.toObject(message.senderKeyDistributionMessage, options); + if (message.imageMessage != null && message.hasOwnProperty("imageMessage")) + object.imageMessage = $root.proto.ImageMessage.toObject(message.imageMessage, options); + if (message.contactMessage != null && message.hasOwnProperty("contactMessage")) + object.contactMessage = $root.proto.ContactMessage.toObject(message.contactMessage, options); + if (message.locationMessage != null && message.hasOwnProperty("locationMessage")) + object.locationMessage = $root.proto.LocationMessage.toObject(message.locationMessage, options); + if (message.extendedTextMessage != null && message.hasOwnProperty("extendedTextMessage")) + object.extendedTextMessage = $root.proto.ExtendedTextMessage.toObject(message.extendedTextMessage, options); + if (message.documentMessage != null && message.hasOwnProperty("documentMessage")) + object.documentMessage = $root.proto.DocumentMessage.toObject(message.documentMessage, options); + if (message.audioMessage != null && message.hasOwnProperty("audioMessage")) + object.audioMessage = $root.proto.AudioMessage.toObject(message.audioMessage, options); + if (message.videoMessage != null && message.hasOwnProperty("videoMessage")) + object.videoMessage = $root.proto.VideoMessage.toObject(message.videoMessage, options); + if (message.call != null && message.hasOwnProperty("call")) + object.call = $root.proto.Call.toObject(message.call, options); + if (message.chat != null && message.hasOwnProperty("chat")) + object.chat = $root.proto.Chat.toObject(message.chat, options); + if (message.protocolMessage != null && message.hasOwnProperty("protocolMessage")) + object.protocolMessage = $root.proto.ProtocolMessage.toObject(message.protocolMessage, options); + if (message.contactsArrayMessage != null && message.hasOwnProperty("contactsArrayMessage")) + object.contactsArrayMessage = $root.proto.ContactsArrayMessage.toObject(message.contactsArrayMessage, options); + if (message.highlyStructuredMessage != null && message.hasOwnProperty("highlyStructuredMessage")) + object.highlyStructuredMessage = $root.proto.HighlyStructuredMessage.toObject(message.highlyStructuredMessage, options); + if (message.fastRatchetKeySenderKeyDistributionMessage != null && message.hasOwnProperty("fastRatchetKeySenderKeyDistributionMessage")) + object.fastRatchetKeySenderKeyDistributionMessage = $root.proto.SenderKeyDistributionMessage.toObject(message.fastRatchetKeySenderKeyDistributionMessage, options); + if (message.sendPaymentMessage != null && message.hasOwnProperty("sendPaymentMessage")) + object.sendPaymentMessage = $root.proto.SendPaymentMessage.toObject(message.sendPaymentMessage, options); + if (message.liveLocationMessage != null && message.hasOwnProperty("liveLocationMessage")) + object.liveLocationMessage = $root.proto.LiveLocationMessage.toObject(message.liveLocationMessage, options); + if (message.requestPaymentMessage != null && message.hasOwnProperty("requestPaymentMessage")) + object.requestPaymentMessage = $root.proto.RequestPaymentMessage.toObject(message.requestPaymentMessage, options); + if (message.declinePaymentRequestMessage != null && message.hasOwnProperty("declinePaymentRequestMessage")) + object.declinePaymentRequestMessage = $root.proto.DeclinePaymentRequestMessage.toObject(message.declinePaymentRequestMessage, options); + if (message.cancelPaymentRequestMessage != null && message.hasOwnProperty("cancelPaymentRequestMessage")) + object.cancelPaymentRequestMessage = $root.proto.CancelPaymentRequestMessage.toObject(message.cancelPaymentRequestMessage, options); + if (message.templateMessage != null && message.hasOwnProperty("templateMessage")) + object.templateMessage = $root.proto.TemplateMessage.toObject(message.templateMessage, options); + if (message.stickerMessage != null && message.hasOwnProperty("stickerMessage")) + object.stickerMessage = $root.proto.StickerMessage.toObject(message.stickerMessage, options); + if (message.groupInviteMessage != null && message.hasOwnProperty("groupInviteMessage")) + object.groupInviteMessage = $root.proto.GroupInviteMessage.toObject(message.groupInviteMessage, options); + if (message.templateButtonReplyMessage != null && message.hasOwnProperty("templateButtonReplyMessage")) + object.templateButtonReplyMessage = $root.proto.TemplateButtonReplyMessage.toObject(message.templateButtonReplyMessage, options); + if (message.productMessage != null && message.hasOwnProperty("productMessage")) + object.productMessage = $root.proto.ProductMessage.toObject(message.productMessage, options); + if (message.deviceSentMessage != null && message.hasOwnProperty("deviceSentMessage")) + object.deviceSentMessage = $root.proto.DeviceSentMessage.toObject(message.deviceSentMessage, options); + if (message.deviceSyncMessage != null && message.hasOwnProperty("deviceSyncMessage")) + object.deviceSyncMessage = $root.proto.DeviceSyncMessage.toObject(message.deviceSyncMessage, options); + return object; + }; + + /** + * Converts this Message to JSON. + * @function toJSON + * @memberof proto.Message + * @instance + * @returns {Object.} JSON object + */ + Message.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Message; + })(); + + proto.MessageKey = (function() { + + /** + * Properties of a MessageKey. + * @memberof proto + * @interface IMessageKey + * @property {string|null} [remoteJid] MessageKey remoteJid + * @property {boolean|null} [fromMe] MessageKey fromMe + * @property {string|null} [id] MessageKey id + * @property {string|null} [participant] MessageKey participant + */ + + /** + * Constructs a new MessageKey. + * @memberof proto + * @classdesc Represents a MessageKey. + * @implements IMessageKey + * @constructor + * @param {proto.IMessageKey=} [properties] Properties to set + */ + function MessageKey(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MessageKey remoteJid. + * @member {string} remoteJid + * @memberof proto.MessageKey + * @instance + */ + MessageKey.prototype.remoteJid = ""; + + /** + * MessageKey fromMe. + * @member {boolean} fromMe + * @memberof proto.MessageKey + * @instance + */ + MessageKey.prototype.fromMe = false; + + /** + * MessageKey id. + * @member {string} id + * @memberof proto.MessageKey + * @instance + */ + MessageKey.prototype.id = ""; + + /** + * MessageKey participant. + * @member {string} participant + * @memberof proto.MessageKey + * @instance + */ + MessageKey.prototype.participant = ""; + + /** + * Creates a new MessageKey instance using the specified properties. + * @function create + * @memberof proto.MessageKey + * @static + * @param {proto.IMessageKey=} [properties] Properties to set + * @returns {proto.MessageKey} MessageKey instance + */ + MessageKey.create = function create(properties) { + return new MessageKey(properties); + }; + + /** + * Encodes the specified MessageKey message. Does not implicitly {@link proto.MessageKey.verify|verify} messages. + * @function encode + * @memberof proto.MessageKey + * @static + * @param {proto.IMessageKey} message MessageKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageKey.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.remoteJid != null && Object.hasOwnProperty.call(message, "remoteJid")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.remoteJid); + if (message.fromMe != null && Object.hasOwnProperty.call(message, "fromMe")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fromMe); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.id); + if (message.participant != null && Object.hasOwnProperty.call(message, "participant")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.participant); + return writer; + }; + + /** + * Encodes the specified MessageKey message, length delimited. Does not implicitly {@link proto.MessageKey.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.MessageKey + * @static + * @param {proto.IMessageKey} message MessageKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageKey.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageKey message from the specified reader or buffer. + * @function decode + * @memberof proto.MessageKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.MessageKey} MessageKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageKey.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.MessageKey(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.remoteJid = reader.string(); + break; + case 2: + message.fromMe = reader.bool(); + break; + case 3: + message.id = reader.string(); + break; + case 4: + message.participant = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageKey message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.MessageKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.MessageKey} MessageKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageKey.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageKey message. + * @function verify + * @memberof proto.MessageKey + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageKey.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.remoteJid != null && message.hasOwnProperty("remoteJid")) + if (!$util.isString(message.remoteJid)) + return "remoteJid: string expected"; + if (message.fromMe != null && message.hasOwnProperty("fromMe")) + if (typeof message.fromMe !== "boolean") + return "fromMe: boolean expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.participant != null && message.hasOwnProperty("participant")) + if (!$util.isString(message.participant)) + return "participant: string expected"; + return null; + }; + + /** + * Creates a MessageKey message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.MessageKey + * @static + * @param {Object.} object Plain object + * @returns {proto.MessageKey} MessageKey + */ + MessageKey.fromObject = function fromObject(object) { + if (object instanceof $root.proto.MessageKey) + return object; + var message = new $root.proto.MessageKey(); + if (object.remoteJid != null) + message.remoteJid = String(object.remoteJid); + if (object.fromMe != null) + message.fromMe = Boolean(object.fromMe); + if (object.id != null) + message.id = String(object.id); + if (object.participant != null) + message.participant = String(object.participant); + return message; + }; + + /** + * Creates a plain object from a MessageKey message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.MessageKey + * @static + * @param {proto.MessageKey} message MessageKey + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageKey.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.remoteJid = ""; + object.fromMe = false; + object.id = ""; + object.participant = ""; + } + if (message.remoteJid != null && message.hasOwnProperty("remoteJid")) + object.remoteJid = message.remoteJid; + if (message.fromMe != null && message.hasOwnProperty("fromMe")) + object.fromMe = message.fromMe; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.participant != null && message.hasOwnProperty("participant")) + object.participant = message.participant; + return object; + }; + + /** + * Converts this MessageKey to JSON. + * @function toJSON + * @memberof proto.MessageKey + * @instance + * @returns {Object.} JSON object + */ + MessageKey.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MessageKey; + })(); + + proto.WebFeatures = (function() { + + /** + * Properties of a WebFeatures. + * @memberof proto + * @interface IWebFeatures + * @property {proto.WebFeatures.WEB_FEATURES_FLAG|null} [labelsDisplay] WebFeatures labelsDisplay + * @property {proto.WebFeatures.WEB_FEATURES_FLAG|null} [voipIndividualOutgoing] WebFeatures voipIndividualOutgoing + * @property {proto.WebFeatures.WEB_FEATURES_FLAG|null} [groupsV3] WebFeatures groupsV3 + * @property {proto.WebFeatures.WEB_FEATURES_FLAG|null} [groupsV3Create] WebFeatures groupsV3Create + * @property {proto.WebFeatures.WEB_FEATURES_FLAG|null} [changeNumberV2] WebFeatures changeNumberV2 + * @property {proto.WebFeatures.WEB_FEATURES_FLAG|null} [queryStatusV3Thumbnail] WebFeatures queryStatusV3Thumbnail + * @property {proto.WebFeatures.WEB_FEATURES_FLAG|null} [liveLocations] WebFeatures liveLocations + * @property {proto.WebFeatures.WEB_FEATURES_FLAG|null} [queryVname] WebFeatures queryVname + * @property {proto.WebFeatures.WEB_FEATURES_FLAG|null} [voipIndividualIncoming] WebFeatures voipIndividualIncoming + * @property {proto.WebFeatures.WEB_FEATURES_FLAG|null} [quickRepliesQuery] WebFeatures quickRepliesQuery + * @property {proto.WebFeatures.WEB_FEATURES_FLAG|null} [payments] WebFeatures payments + * @property {proto.WebFeatures.WEB_FEATURES_FLAG|null} [stickerPackQuery] WebFeatures stickerPackQuery + * @property {proto.WebFeatures.WEB_FEATURES_FLAG|null} [liveLocationsFinal] WebFeatures liveLocationsFinal + * @property {proto.WebFeatures.WEB_FEATURES_FLAG|null} [labelsEdit] WebFeatures labelsEdit + * @property {proto.WebFeatures.WEB_FEATURES_FLAG|null} [mediaUpload] WebFeatures mediaUpload + * @property {proto.WebFeatures.WEB_FEATURES_FLAG|null} [mediaUploadRichQuickReplies] WebFeatures mediaUploadRichQuickReplies + * @property {proto.WebFeatures.WEB_FEATURES_FLAG|null} [vnameV2] WebFeatures vnameV2 + * @property {proto.WebFeatures.WEB_FEATURES_FLAG|null} [videoPlaybackUrl] WebFeatures videoPlaybackUrl + * @property {proto.WebFeatures.WEB_FEATURES_FLAG|null} [statusRanking] WebFeatures statusRanking + * @property {proto.WebFeatures.WEB_FEATURES_FLAG|null} [voipIndividualVideo] WebFeatures voipIndividualVideo + * @property {proto.WebFeatures.WEB_FEATURES_FLAG|null} [thirdPartyStickers] WebFeatures thirdPartyStickers + * @property {proto.WebFeatures.WEB_FEATURES_FLAG|null} [frequentlyForwardedSetting] WebFeatures frequentlyForwardedSetting + * @property {proto.WebFeatures.WEB_FEATURES_FLAG|null} [groupsV4JoinPermission] WebFeatures groupsV4JoinPermission + * @property {proto.WebFeatures.WEB_FEATURES_FLAG|null} [recentStickers] WebFeatures recentStickers + * @property {proto.WebFeatures.WEB_FEATURES_FLAG|null} [catalog] WebFeatures catalog + * @property {proto.WebFeatures.WEB_FEATURES_FLAG|null} [starredStickers] WebFeatures starredStickers + * @property {proto.WebFeatures.WEB_FEATURES_FLAG|null} [voipGroupCall] WebFeatures voipGroupCall + * @property {proto.WebFeatures.WEB_FEATURES_FLAG|null} [templateMessage] WebFeatures templateMessage + * @property {proto.WebFeatures.WEB_FEATURES_FLAG|null} [templateMessageInteractivity] WebFeatures templateMessageInteractivity + * @property {proto.WebFeatures.WEB_FEATURES_FLAG|null} [ephemeralMessages] WebFeatures ephemeralMessages + */ + + /** + * Constructs a new WebFeatures. + * @memberof proto + * @classdesc Represents a WebFeatures. + * @implements IWebFeatures + * @constructor + * @param {proto.IWebFeatures=} [properties] Properties to set + */ + function WebFeatures(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WebFeatures labelsDisplay. + * @member {proto.WebFeatures.WEB_FEATURES_FLAG} labelsDisplay + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.labelsDisplay = 0; + + /** + * WebFeatures voipIndividualOutgoing. + * @member {proto.WebFeatures.WEB_FEATURES_FLAG} voipIndividualOutgoing + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.voipIndividualOutgoing = 0; + + /** + * WebFeatures groupsV3. + * @member {proto.WebFeatures.WEB_FEATURES_FLAG} groupsV3 + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.groupsV3 = 0; + + /** + * WebFeatures groupsV3Create. + * @member {proto.WebFeatures.WEB_FEATURES_FLAG} groupsV3Create + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.groupsV3Create = 0; + + /** + * WebFeatures changeNumberV2. + * @member {proto.WebFeatures.WEB_FEATURES_FLAG} changeNumberV2 + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.changeNumberV2 = 0; + + /** + * WebFeatures queryStatusV3Thumbnail. + * @member {proto.WebFeatures.WEB_FEATURES_FLAG} queryStatusV3Thumbnail + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.queryStatusV3Thumbnail = 0; + + /** + * WebFeatures liveLocations. + * @member {proto.WebFeatures.WEB_FEATURES_FLAG} liveLocations + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.liveLocations = 0; + + /** + * WebFeatures queryVname. + * @member {proto.WebFeatures.WEB_FEATURES_FLAG} queryVname + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.queryVname = 0; + + /** + * WebFeatures voipIndividualIncoming. + * @member {proto.WebFeatures.WEB_FEATURES_FLAG} voipIndividualIncoming + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.voipIndividualIncoming = 0; + + /** + * WebFeatures quickRepliesQuery. + * @member {proto.WebFeatures.WEB_FEATURES_FLAG} quickRepliesQuery + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.quickRepliesQuery = 0; + + /** + * WebFeatures payments. + * @member {proto.WebFeatures.WEB_FEATURES_FLAG} payments + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.payments = 0; + + /** + * WebFeatures stickerPackQuery. + * @member {proto.WebFeatures.WEB_FEATURES_FLAG} stickerPackQuery + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.stickerPackQuery = 0; + + /** + * WebFeatures liveLocationsFinal. + * @member {proto.WebFeatures.WEB_FEATURES_FLAG} liveLocationsFinal + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.liveLocationsFinal = 0; + + /** + * WebFeatures labelsEdit. + * @member {proto.WebFeatures.WEB_FEATURES_FLAG} labelsEdit + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.labelsEdit = 0; + + /** + * WebFeatures mediaUpload. + * @member {proto.WebFeatures.WEB_FEATURES_FLAG} mediaUpload + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.mediaUpload = 0; + + /** + * WebFeatures mediaUploadRichQuickReplies. + * @member {proto.WebFeatures.WEB_FEATURES_FLAG} mediaUploadRichQuickReplies + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.mediaUploadRichQuickReplies = 0; + + /** + * WebFeatures vnameV2. + * @member {proto.WebFeatures.WEB_FEATURES_FLAG} vnameV2 + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.vnameV2 = 0; + + /** + * WebFeatures videoPlaybackUrl. + * @member {proto.WebFeatures.WEB_FEATURES_FLAG} videoPlaybackUrl + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.videoPlaybackUrl = 0; + + /** + * WebFeatures statusRanking. + * @member {proto.WebFeatures.WEB_FEATURES_FLAG} statusRanking + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.statusRanking = 0; + + /** + * WebFeatures voipIndividualVideo. + * @member {proto.WebFeatures.WEB_FEATURES_FLAG} voipIndividualVideo + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.voipIndividualVideo = 0; + + /** + * WebFeatures thirdPartyStickers. + * @member {proto.WebFeatures.WEB_FEATURES_FLAG} thirdPartyStickers + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.thirdPartyStickers = 0; + + /** + * WebFeatures frequentlyForwardedSetting. + * @member {proto.WebFeatures.WEB_FEATURES_FLAG} frequentlyForwardedSetting + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.frequentlyForwardedSetting = 0; + + /** + * WebFeatures groupsV4JoinPermission. + * @member {proto.WebFeatures.WEB_FEATURES_FLAG} groupsV4JoinPermission + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.groupsV4JoinPermission = 0; + + /** + * WebFeatures recentStickers. + * @member {proto.WebFeatures.WEB_FEATURES_FLAG} recentStickers + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.recentStickers = 0; + + /** + * WebFeatures catalog. + * @member {proto.WebFeatures.WEB_FEATURES_FLAG} catalog + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.catalog = 0; + + /** + * WebFeatures starredStickers. + * @member {proto.WebFeatures.WEB_FEATURES_FLAG} starredStickers + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.starredStickers = 0; + + /** + * WebFeatures voipGroupCall. + * @member {proto.WebFeatures.WEB_FEATURES_FLAG} voipGroupCall + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.voipGroupCall = 0; + + /** + * WebFeatures templateMessage. + * @member {proto.WebFeatures.WEB_FEATURES_FLAG} templateMessage + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.templateMessage = 0; + + /** + * WebFeatures templateMessageInteractivity. + * @member {proto.WebFeatures.WEB_FEATURES_FLAG} templateMessageInteractivity + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.templateMessageInteractivity = 0; + + /** + * WebFeatures ephemeralMessages. + * @member {proto.WebFeatures.WEB_FEATURES_FLAG} ephemeralMessages + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.ephemeralMessages = 0; + + /** + * Creates a new WebFeatures instance using the specified properties. + * @function create + * @memberof proto.WebFeatures + * @static + * @param {proto.IWebFeatures=} [properties] Properties to set + * @returns {proto.WebFeatures} WebFeatures instance + */ + WebFeatures.create = function create(properties) { + return new WebFeatures(properties); + }; + + /** + * Encodes the specified WebFeatures message. Does not implicitly {@link proto.WebFeatures.verify|verify} messages. + * @function encode + * @memberof proto.WebFeatures + * @static + * @param {proto.IWebFeatures} message WebFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebFeatures.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.labelsDisplay != null && Object.hasOwnProperty.call(message, "labelsDisplay")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.labelsDisplay); + if (message.voipIndividualOutgoing != null && Object.hasOwnProperty.call(message, "voipIndividualOutgoing")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.voipIndividualOutgoing); + if (message.groupsV3 != null && Object.hasOwnProperty.call(message, "groupsV3")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.groupsV3); + if (message.groupsV3Create != null && Object.hasOwnProperty.call(message, "groupsV3Create")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.groupsV3Create); + if (message.changeNumberV2 != null && Object.hasOwnProperty.call(message, "changeNumberV2")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.changeNumberV2); + if (message.queryStatusV3Thumbnail != null && Object.hasOwnProperty.call(message, "queryStatusV3Thumbnail")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.queryStatusV3Thumbnail); + if (message.liveLocations != null && Object.hasOwnProperty.call(message, "liveLocations")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.liveLocations); + if (message.queryVname != null && Object.hasOwnProperty.call(message, "queryVname")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.queryVname); + if (message.voipIndividualIncoming != null && Object.hasOwnProperty.call(message, "voipIndividualIncoming")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.voipIndividualIncoming); + if (message.quickRepliesQuery != null && Object.hasOwnProperty.call(message, "quickRepliesQuery")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.quickRepliesQuery); + if (message.payments != null && Object.hasOwnProperty.call(message, "payments")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.payments); + if (message.stickerPackQuery != null && Object.hasOwnProperty.call(message, "stickerPackQuery")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.stickerPackQuery); + if (message.liveLocationsFinal != null && Object.hasOwnProperty.call(message, "liveLocationsFinal")) + writer.uint32(/* id 13, wireType 0 =*/104).int32(message.liveLocationsFinal); + if (message.labelsEdit != null && Object.hasOwnProperty.call(message, "labelsEdit")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.labelsEdit); + if (message.mediaUpload != null && Object.hasOwnProperty.call(message, "mediaUpload")) + writer.uint32(/* id 15, wireType 0 =*/120).int32(message.mediaUpload); + if (message.mediaUploadRichQuickReplies != null && Object.hasOwnProperty.call(message, "mediaUploadRichQuickReplies")) + writer.uint32(/* id 18, wireType 0 =*/144).int32(message.mediaUploadRichQuickReplies); + if (message.vnameV2 != null && Object.hasOwnProperty.call(message, "vnameV2")) + writer.uint32(/* id 19, wireType 0 =*/152).int32(message.vnameV2); + if (message.videoPlaybackUrl != null && Object.hasOwnProperty.call(message, "videoPlaybackUrl")) + writer.uint32(/* id 20, wireType 0 =*/160).int32(message.videoPlaybackUrl); + if (message.statusRanking != null && Object.hasOwnProperty.call(message, "statusRanking")) + writer.uint32(/* id 21, wireType 0 =*/168).int32(message.statusRanking); + if (message.voipIndividualVideo != null && Object.hasOwnProperty.call(message, "voipIndividualVideo")) + writer.uint32(/* id 22, wireType 0 =*/176).int32(message.voipIndividualVideo); + if (message.thirdPartyStickers != null && Object.hasOwnProperty.call(message, "thirdPartyStickers")) + writer.uint32(/* id 23, wireType 0 =*/184).int32(message.thirdPartyStickers); + if (message.frequentlyForwardedSetting != null && Object.hasOwnProperty.call(message, "frequentlyForwardedSetting")) + writer.uint32(/* id 24, wireType 0 =*/192).int32(message.frequentlyForwardedSetting); + if (message.groupsV4JoinPermission != null && Object.hasOwnProperty.call(message, "groupsV4JoinPermission")) + writer.uint32(/* id 25, wireType 0 =*/200).int32(message.groupsV4JoinPermission); + if (message.recentStickers != null && Object.hasOwnProperty.call(message, "recentStickers")) + writer.uint32(/* id 26, wireType 0 =*/208).int32(message.recentStickers); + if (message.catalog != null && Object.hasOwnProperty.call(message, "catalog")) + writer.uint32(/* id 27, wireType 0 =*/216).int32(message.catalog); + if (message.starredStickers != null && Object.hasOwnProperty.call(message, "starredStickers")) + writer.uint32(/* id 28, wireType 0 =*/224).int32(message.starredStickers); + if (message.voipGroupCall != null && Object.hasOwnProperty.call(message, "voipGroupCall")) + writer.uint32(/* id 29, wireType 0 =*/232).int32(message.voipGroupCall); + if (message.templateMessage != null && Object.hasOwnProperty.call(message, "templateMessage")) + writer.uint32(/* id 30, wireType 0 =*/240).int32(message.templateMessage); + if (message.templateMessageInteractivity != null && Object.hasOwnProperty.call(message, "templateMessageInteractivity")) + writer.uint32(/* id 31, wireType 0 =*/248).int32(message.templateMessageInteractivity); + if (message.ephemeralMessages != null && Object.hasOwnProperty.call(message, "ephemeralMessages")) + writer.uint32(/* id 32, wireType 0 =*/256).int32(message.ephemeralMessages); + return writer; + }; + + /** + * Encodes the specified WebFeatures message, length delimited. Does not implicitly {@link proto.WebFeatures.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.WebFeatures + * @static + * @param {proto.IWebFeatures} message WebFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebFeatures.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WebFeatures message from the specified reader or buffer. + * @function decode + * @memberof proto.WebFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.WebFeatures} WebFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebFeatures.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.WebFeatures(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.labelsDisplay = reader.int32(); + break; + case 2: + message.voipIndividualOutgoing = reader.int32(); + break; + case 3: + message.groupsV3 = reader.int32(); + break; + case 4: + message.groupsV3Create = reader.int32(); + break; + case 5: + message.changeNumberV2 = reader.int32(); + break; + case 6: + message.queryStatusV3Thumbnail = reader.int32(); + break; + case 7: + message.liveLocations = reader.int32(); + break; + case 8: + message.queryVname = reader.int32(); + break; + case 9: + message.voipIndividualIncoming = reader.int32(); + break; + case 10: + message.quickRepliesQuery = reader.int32(); + break; + case 11: + message.payments = reader.int32(); + break; + case 12: + message.stickerPackQuery = reader.int32(); + break; + case 13: + message.liveLocationsFinal = reader.int32(); + break; + case 14: + message.labelsEdit = reader.int32(); + break; + case 15: + message.mediaUpload = reader.int32(); + break; + case 18: + message.mediaUploadRichQuickReplies = reader.int32(); + break; + case 19: + message.vnameV2 = reader.int32(); + break; + case 20: + message.videoPlaybackUrl = reader.int32(); + break; + case 21: + message.statusRanking = reader.int32(); + break; + case 22: + message.voipIndividualVideo = reader.int32(); + break; + case 23: + message.thirdPartyStickers = reader.int32(); + break; + case 24: + message.frequentlyForwardedSetting = reader.int32(); + break; + case 25: + message.groupsV4JoinPermission = reader.int32(); + break; + case 26: + message.recentStickers = reader.int32(); + break; + case 27: + message.catalog = reader.int32(); + break; + case 28: + message.starredStickers = reader.int32(); + break; + case 29: + message.voipGroupCall = reader.int32(); + break; + case 30: + message.templateMessage = reader.int32(); + break; + case 31: + message.templateMessageInteractivity = reader.int32(); + break; + case 32: + message.ephemeralMessages = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WebFeatures message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.WebFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.WebFeatures} WebFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebFeatures.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WebFeatures message. + * @function verify + * @memberof proto.WebFeatures + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WebFeatures.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.labelsDisplay != null && message.hasOwnProperty("labelsDisplay")) + switch (message.labelsDisplay) { + default: + return "labelsDisplay: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.voipIndividualOutgoing != null && message.hasOwnProperty("voipIndividualOutgoing")) + switch (message.voipIndividualOutgoing) { + default: + return "voipIndividualOutgoing: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.groupsV3 != null && message.hasOwnProperty("groupsV3")) + switch (message.groupsV3) { + default: + return "groupsV3: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.groupsV3Create != null && message.hasOwnProperty("groupsV3Create")) + switch (message.groupsV3Create) { + default: + return "groupsV3Create: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.changeNumberV2 != null && message.hasOwnProperty("changeNumberV2")) + switch (message.changeNumberV2) { + default: + return "changeNumberV2: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.queryStatusV3Thumbnail != null && message.hasOwnProperty("queryStatusV3Thumbnail")) + switch (message.queryStatusV3Thumbnail) { + default: + return "queryStatusV3Thumbnail: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.liveLocations != null && message.hasOwnProperty("liveLocations")) + switch (message.liveLocations) { + default: + return "liveLocations: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.queryVname != null && message.hasOwnProperty("queryVname")) + switch (message.queryVname) { + default: + return "queryVname: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.voipIndividualIncoming != null && message.hasOwnProperty("voipIndividualIncoming")) + switch (message.voipIndividualIncoming) { + default: + return "voipIndividualIncoming: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.quickRepliesQuery != null && message.hasOwnProperty("quickRepliesQuery")) + switch (message.quickRepliesQuery) { + default: + return "quickRepliesQuery: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.payments != null && message.hasOwnProperty("payments")) + switch (message.payments) { + default: + return "payments: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.stickerPackQuery != null && message.hasOwnProperty("stickerPackQuery")) + switch (message.stickerPackQuery) { + default: + return "stickerPackQuery: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.liveLocationsFinal != null && message.hasOwnProperty("liveLocationsFinal")) + switch (message.liveLocationsFinal) { + default: + return "liveLocationsFinal: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.labelsEdit != null && message.hasOwnProperty("labelsEdit")) + switch (message.labelsEdit) { + default: + return "labelsEdit: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.mediaUpload != null && message.hasOwnProperty("mediaUpload")) + switch (message.mediaUpload) { + default: + return "mediaUpload: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.mediaUploadRichQuickReplies != null && message.hasOwnProperty("mediaUploadRichQuickReplies")) + switch (message.mediaUploadRichQuickReplies) { + default: + return "mediaUploadRichQuickReplies: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.vnameV2 != null && message.hasOwnProperty("vnameV2")) + switch (message.vnameV2) { + default: + return "vnameV2: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.videoPlaybackUrl != null && message.hasOwnProperty("videoPlaybackUrl")) + switch (message.videoPlaybackUrl) { + default: + return "videoPlaybackUrl: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.statusRanking != null && message.hasOwnProperty("statusRanking")) + switch (message.statusRanking) { + default: + return "statusRanking: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.voipIndividualVideo != null && message.hasOwnProperty("voipIndividualVideo")) + switch (message.voipIndividualVideo) { + default: + return "voipIndividualVideo: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.thirdPartyStickers != null && message.hasOwnProperty("thirdPartyStickers")) + switch (message.thirdPartyStickers) { + default: + return "thirdPartyStickers: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.frequentlyForwardedSetting != null && message.hasOwnProperty("frequentlyForwardedSetting")) + switch (message.frequentlyForwardedSetting) { + default: + return "frequentlyForwardedSetting: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.groupsV4JoinPermission != null && message.hasOwnProperty("groupsV4JoinPermission")) + switch (message.groupsV4JoinPermission) { + default: + return "groupsV4JoinPermission: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.recentStickers != null && message.hasOwnProperty("recentStickers")) + switch (message.recentStickers) { + default: + return "recentStickers: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.catalog != null && message.hasOwnProperty("catalog")) + switch (message.catalog) { + default: + return "catalog: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.starredStickers != null && message.hasOwnProperty("starredStickers")) + switch (message.starredStickers) { + default: + return "starredStickers: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.voipGroupCall != null && message.hasOwnProperty("voipGroupCall")) + switch (message.voipGroupCall) { + default: + return "voipGroupCall: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.templateMessage != null && message.hasOwnProperty("templateMessage")) + switch (message.templateMessage) { + default: + return "templateMessage: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.templateMessageInteractivity != null && message.hasOwnProperty("templateMessageInteractivity")) + switch (message.templateMessageInteractivity) { + default: + return "templateMessageInteractivity: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.ephemeralMessages != null && message.hasOwnProperty("ephemeralMessages")) + switch (message.ephemeralMessages) { + default: + return "ephemeralMessages: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a WebFeatures message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.WebFeatures + * @static + * @param {Object.} object Plain object + * @returns {proto.WebFeatures} WebFeatures + */ + WebFeatures.fromObject = function fromObject(object) { + if (object instanceof $root.proto.WebFeatures) + return object; + var message = new $root.proto.WebFeatures(); + switch (object.labelsDisplay) { + case "NOT_STARTED": + case 0: + message.labelsDisplay = 0; + break; + case "FORCE_UPGRADE": + case 1: + message.labelsDisplay = 1; + break; + case "DEVELOPMENT": + case 2: + message.labelsDisplay = 2; + break; + case "PRODUCTION": + case 3: + message.labelsDisplay = 3; + break; + } + switch (object.voipIndividualOutgoing) { + case "NOT_STARTED": + case 0: + message.voipIndividualOutgoing = 0; + break; + case "FORCE_UPGRADE": + case 1: + message.voipIndividualOutgoing = 1; + break; + case "DEVELOPMENT": + case 2: + message.voipIndividualOutgoing = 2; + break; + case "PRODUCTION": + case 3: + message.voipIndividualOutgoing = 3; + break; + } + switch (object.groupsV3) { + case "NOT_STARTED": + case 0: + message.groupsV3 = 0; + break; + case "FORCE_UPGRADE": + case 1: + message.groupsV3 = 1; + break; + case "DEVELOPMENT": + case 2: + message.groupsV3 = 2; + break; + case "PRODUCTION": + case 3: + message.groupsV3 = 3; + break; + } + switch (object.groupsV3Create) { + case "NOT_STARTED": + case 0: + message.groupsV3Create = 0; + break; + case "FORCE_UPGRADE": + case 1: + message.groupsV3Create = 1; + break; + case "DEVELOPMENT": + case 2: + message.groupsV3Create = 2; + break; + case "PRODUCTION": + case 3: + message.groupsV3Create = 3; + break; + } + switch (object.changeNumberV2) { + case "NOT_STARTED": + case 0: + message.changeNumberV2 = 0; + break; + case "FORCE_UPGRADE": + case 1: + message.changeNumberV2 = 1; + break; + case "DEVELOPMENT": + case 2: + message.changeNumberV2 = 2; + break; + case "PRODUCTION": + case 3: + message.changeNumberV2 = 3; + break; + } + switch (object.queryStatusV3Thumbnail) { + case "NOT_STARTED": + case 0: + message.queryStatusV3Thumbnail = 0; + break; + case "FORCE_UPGRADE": + case 1: + message.queryStatusV3Thumbnail = 1; + break; + case "DEVELOPMENT": + case 2: + message.queryStatusV3Thumbnail = 2; + break; + case "PRODUCTION": + case 3: + message.queryStatusV3Thumbnail = 3; + break; + } + switch (object.liveLocations) { + case "NOT_STARTED": + case 0: + message.liveLocations = 0; + break; + case "FORCE_UPGRADE": + case 1: + message.liveLocations = 1; + break; + case "DEVELOPMENT": + case 2: + message.liveLocations = 2; + break; + case "PRODUCTION": + case 3: + message.liveLocations = 3; + break; + } + switch (object.queryVname) { + case "NOT_STARTED": + case 0: + message.queryVname = 0; + break; + case "FORCE_UPGRADE": + case 1: + message.queryVname = 1; + break; + case "DEVELOPMENT": + case 2: + message.queryVname = 2; + break; + case "PRODUCTION": + case 3: + message.queryVname = 3; + break; + } + switch (object.voipIndividualIncoming) { + case "NOT_STARTED": + case 0: + message.voipIndividualIncoming = 0; + break; + case "FORCE_UPGRADE": + case 1: + message.voipIndividualIncoming = 1; + break; + case "DEVELOPMENT": + case 2: + message.voipIndividualIncoming = 2; + break; + case "PRODUCTION": + case 3: + message.voipIndividualIncoming = 3; + break; + } + switch (object.quickRepliesQuery) { + case "NOT_STARTED": + case 0: + message.quickRepliesQuery = 0; + break; + case "FORCE_UPGRADE": + case 1: + message.quickRepliesQuery = 1; + break; + case "DEVELOPMENT": + case 2: + message.quickRepliesQuery = 2; + break; + case "PRODUCTION": + case 3: + message.quickRepliesQuery = 3; + break; + } + switch (object.payments) { + case "NOT_STARTED": + case 0: + message.payments = 0; + break; + case "FORCE_UPGRADE": + case 1: + message.payments = 1; + break; + case "DEVELOPMENT": + case 2: + message.payments = 2; + break; + case "PRODUCTION": + case 3: + message.payments = 3; + break; + } + switch (object.stickerPackQuery) { + case "NOT_STARTED": + case 0: + message.stickerPackQuery = 0; + break; + case "FORCE_UPGRADE": + case 1: + message.stickerPackQuery = 1; + break; + case "DEVELOPMENT": + case 2: + message.stickerPackQuery = 2; + break; + case "PRODUCTION": + case 3: + message.stickerPackQuery = 3; + break; + } + switch (object.liveLocationsFinal) { + case "NOT_STARTED": + case 0: + message.liveLocationsFinal = 0; + break; + case "FORCE_UPGRADE": + case 1: + message.liveLocationsFinal = 1; + break; + case "DEVELOPMENT": + case 2: + message.liveLocationsFinal = 2; + break; + case "PRODUCTION": + case 3: + message.liveLocationsFinal = 3; + break; + } + switch (object.labelsEdit) { + case "NOT_STARTED": + case 0: + message.labelsEdit = 0; + break; + case "FORCE_UPGRADE": + case 1: + message.labelsEdit = 1; + break; + case "DEVELOPMENT": + case 2: + message.labelsEdit = 2; + break; + case "PRODUCTION": + case 3: + message.labelsEdit = 3; + break; + } + switch (object.mediaUpload) { + case "NOT_STARTED": + case 0: + message.mediaUpload = 0; + break; + case "FORCE_UPGRADE": + case 1: + message.mediaUpload = 1; + break; + case "DEVELOPMENT": + case 2: + message.mediaUpload = 2; + break; + case "PRODUCTION": + case 3: + message.mediaUpload = 3; + break; + } + switch (object.mediaUploadRichQuickReplies) { + case "NOT_STARTED": + case 0: + message.mediaUploadRichQuickReplies = 0; + break; + case "FORCE_UPGRADE": + case 1: + message.mediaUploadRichQuickReplies = 1; + break; + case "DEVELOPMENT": + case 2: + message.mediaUploadRichQuickReplies = 2; + break; + case "PRODUCTION": + case 3: + message.mediaUploadRichQuickReplies = 3; + break; + } + switch (object.vnameV2) { + case "NOT_STARTED": + case 0: + message.vnameV2 = 0; + break; + case "FORCE_UPGRADE": + case 1: + message.vnameV2 = 1; + break; + case "DEVELOPMENT": + case 2: + message.vnameV2 = 2; + break; + case "PRODUCTION": + case 3: + message.vnameV2 = 3; + break; + } + switch (object.videoPlaybackUrl) { + case "NOT_STARTED": + case 0: + message.videoPlaybackUrl = 0; + break; + case "FORCE_UPGRADE": + case 1: + message.videoPlaybackUrl = 1; + break; + case "DEVELOPMENT": + case 2: + message.videoPlaybackUrl = 2; + break; + case "PRODUCTION": + case 3: + message.videoPlaybackUrl = 3; + break; + } + switch (object.statusRanking) { + case "NOT_STARTED": + case 0: + message.statusRanking = 0; + break; + case "FORCE_UPGRADE": + case 1: + message.statusRanking = 1; + break; + case "DEVELOPMENT": + case 2: + message.statusRanking = 2; + break; + case "PRODUCTION": + case 3: + message.statusRanking = 3; + break; + } + switch (object.voipIndividualVideo) { + case "NOT_STARTED": + case 0: + message.voipIndividualVideo = 0; + break; + case "FORCE_UPGRADE": + case 1: + message.voipIndividualVideo = 1; + break; + case "DEVELOPMENT": + case 2: + message.voipIndividualVideo = 2; + break; + case "PRODUCTION": + case 3: + message.voipIndividualVideo = 3; + break; + } + switch (object.thirdPartyStickers) { + case "NOT_STARTED": + case 0: + message.thirdPartyStickers = 0; + break; + case "FORCE_UPGRADE": + case 1: + message.thirdPartyStickers = 1; + break; + case "DEVELOPMENT": + case 2: + message.thirdPartyStickers = 2; + break; + case "PRODUCTION": + case 3: + message.thirdPartyStickers = 3; + break; + } + switch (object.frequentlyForwardedSetting) { + case "NOT_STARTED": + case 0: + message.frequentlyForwardedSetting = 0; + break; + case "FORCE_UPGRADE": + case 1: + message.frequentlyForwardedSetting = 1; + break; + case "DEVELOPMENT": + case 2: + message.frequentlyForwardedSetting = 2; + break; + case "PRODUCTION": + case 3: + message.frequentlyForwardedSetting = 3; + break; + } + switch (object.groupsV4JoinPermission) { + case "NOT_STARTED": + case 0: + message.groupsV4JoinPermission = 0; + break; + case "FORCE_UPGRADE": + case 1: + message.groupsV4JoinPermission = 1; + break; + case "DEVELOPMENT": + case 2: + message.groupsV4JoinPermission = 2; + break; + case "PRODUCTION": + case 3: + message.groupsV4JoinPermission = 3; + break; + } + switch (object.recentStickers) { + case "NOT_STARTED": + case 0: + message.recentStickers = 0; + break; + case "FORCE_UPGRADE": + case 1: + message.recentStickers = 1; + break; + case "DEVELOPMENT": + case 2: + message.recentStickers = 2; + break; + case "PRODUCTION": + case 3: + message.recentStickers = 3; + break; + } + switch (object.catalog) { + case "NOT_STARTED": + case 0: + message.catalog = 0; + break; + case "FORCE_UPGRADE": + case 1: + message.catalog = 1; + break; + case "DEVELOPMENT": + case 2: + message.catalog = 2; + break; + case "PRODUCTION": + case 3: + message.catalog = 3; + break; + } + switch (object.starredStickers) { + case "NOT_STARTED": + case 0: + message.starredStickers = 0; + break; + case "FORCE_UPGRADE": + case 1: + message.starredStickers = 1; + break; + case "DEVELOPMENT": + case 2: + message.starredStickers = 2; + break; + case "PRODUCTION": + case 3: + message.starredStickers = 3; + break; + } + switch (object.voipGroupCall) { + case "NOT_STARTED": + case 0: + message.voipGroupCall = 0; + break; + case "FORCE_UPGRADE": + case 1: + message.voipGroupCall = 1; + break; + case "DEVELOPMENT": + case 2: + message.voipGroupCall = 2; + break; + case "PRODUCTION": + case 3: + message.voipGroupCall = 3; + break; + } + switch (object.templateMessage) { + case "NOT_STARTED": + case 0: + message.templateMessage = 0; + break; + case "FORCE_UPGRADE": + case 1: + message.templateMessage = 1; + break; + case "DEVELOPMENT": + case 2: + message.templateMessage = 2; + break; + case "PRODUCTION": + case 3: + message.templateMessage = 3; + break; + } + switch (object.templateMessageInteractivity) { + case "NOT_STARTED": + case 0: + message.templateMessageInteractivity = 0; + break; + case "FORCE_UPGRADE": + case 1: + message.templateMessageInteractivity = 1; + break; + case "DEVELOPMENT": + case 2: + message.templateMessageInteractivity = 2; + break; + case "PRODUCTION": + case 3: + message.templateMessageInteractivity = 3; + break; + } + switch (object.ephemeralMessages) { + case "NOT_STARTED": + case 0: + message.ephemeralMessages = 0; + break; + case "FORCE_UPGRADE": + case 1: + message.ephemeralMessages = 1; + break; + case "DEVELOPMENT": + case 2: + message.ephemeralMessages = 2; + break; + case "PRODUCTION": + case 3: + message.ephemeralMessages = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a WebFeatures message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.WebFeatures + * @static + * @param {proto.WebFeatures} message WebFeatures + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WebFeatures.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.labelsDisplay = options.enums === String ? "NOT_STARTED" : 0; + object.voipIndividualOutgoing = options.enums === String ? "NOT_STARTED" : 0; + object.groupsV3 = options.enums === String ? "NOT_STARTED" : 0; + object.groupsV3Create = options.enums === String ? "NOT_STARTED" : 0; + object.changeNumberV2 = options.enums === String ? "NOT_STARTED" : 0; + object.queryStatusV3Thumbnail = options.enums === String ? "NOT_STARTED" : 0; + object.liveLocations = options.enums === String ? "NOT_STARTED" : 0; + object.queryVname = options.enums === String ? "NOT_STARTED" : 0; + object.voipIndividualIncoming = options.enums === String ? "NOT_STARTED" : 0; + object.quickRepliesQuery = options.enums === String ? "NOT_STARTED" : 0; + object.payments = options.enums === String ? "NOT_STARTED" : 0; + object.stickerPackQuery = options.enums === String ? "NOT_STARTED" : 0; + object.liveLocationsFinal = options.enums === String ? "NOT_STARTED" : 0; + object.labelsEdit = options.enums === String ? "NOT_STARTED" : 0; + object.mediaUpload = options.enums === String ? "NOT_STARTED" : 0; + object.mediaUploadRichQuickReplies = options.enums === String ? "NOT_STARTED" : 0; + object.vnameV2 = options.enums === String ? "NOT_STARTED" : 0; + object.videoPlaybackUrl = options.enums === String ? "NOT_STARTED" : 0; + object.statusRanking = options.enums === String ? "NOT_STARTED" : 0; + object.voipIndividualVideo = options.enums === String ? "NOT_STARTED" : 0; + object.thirdPartyStickers = options.enums === String ? "NOT_STARTED" : 0; + object.frequentlyForwardedSetting = options.enums === String ? "NOT_STARTED" : 0; + object.groupsV4JoinPermission = options.enums === String ? "NOT_STARTED" : 0; + object.recentStickers = options.enums === String ? "NOT_STARTED" : 0; + object.catalog = options.enums === String ? "NOT_STARTED" : 0; + object.starredStickers = options.enums === String ? "NOT_STARTED" : 0; + object.voipGroupCall = options.enums === String ? "NOT_STARTED" : 0; + object.templateMessage = options.enums === String ? "NOT_STARTED" : 0; + object.templateMessageInteractivity = options.enums === String ? "NOT_STARTED" : 0; + object.ephemeralMessages = options.enums === String ? "NOT_STARTED" : 0; + } + if (message.labelsDisplay != null && message.hasOwnProperty("labelsDisplay")) + object.labelsDisplay = options.enums === String ? $root.proto.WebFeatures.WEB_FEATURES_FLAG[message.labelsDisplay] : message.labelsDisplay; + if (message.voipIndividualOutgoing != null && message.hasOwnProperty("voipIndividualOutgoing")) + object.voipIndividualOutgoing = options.enums === String ? $root.proto.WebFeatures.WEB_FEATURES_FLAG[message.voipIndividualOutgoing] : message.voipIndividualOutgoing; + if (message.groupsV3 != null && message.hasOwnProperty("groupsV3")) + object.groupsV3 = options.enums === String ? $root.proto.WebFeatures.WEB_FEATURES_FLAG[message.groupsV3] : message.groupsV3; + if (message.groupsV3Create != null && message.hasOwnProperty("groupsV3Create")) + object.groupsV3Create = options.enums === String ? $root.proto.WebFeatures.WEB_FEATURES_FLAG[message.groupsV3Create] : message.groupsV3Create; + if (message.changeNumberV2 != null && message.hasOwnProperty("changeNumberV2")) + object.changeNumberV2 = options.enums === String ? $root.proto.WebFeatures.WEB_FEATURES_FLAG[message.changeNumberV2] : message.changeNumberV2; + if (message.queryStatusV3Thumbnail != null && message.hasOwnProperty("queryStatusV3Thumbnail")) + object.queryStatusV3Thumbnail = options.enums === String ? $root.proto.WebFeatures.WEB_FEATURES_FLAG[message.queryStatusV3Thumbnail] : message.queryStatusV3Thumbnail; + if (message.liveLocations != null && message.hasOwnProperty("liveLocations")) + object.liveLocations = options.enums === String ? $root.proto.WebFeatures.WEB_FEATURES_FLAG[message.liveLocations] : message.liveLocations; + if (message.queryVname != null && message.hasOwnProperty("queryVname")) + object.queryVname = options.enums === String ? $root.proto.WebFeatures.WEB_FEATURES_FLAG[message.queryVname] : message.queryVname; + if (message.voipIndividualIncoming != null && message.hasOwnProperty("voipIndividualIncoming")) + object.voipIndividualIncoming = options.enums === String ? $root.proto.WebFeatures.WEB_FEATURES_FLAG[message.voipIndividualIncoming] : message.voipIndividualIncoming; + if (message.quickRepliesQuery != null && message.hasOwnProperty("quickRepliesQuery")) + object.quickRepliesQuery = options.enums === String ? $root.proto.WebFeatures.WEB_FEATURES_FLAG[message.quickRepliesQuery] : message.quickRepliesQuery; + if (message.payments != null && message.hasOwnProperty("payments")) + object.payments = options.enums === String ? $root.proto.WebFeatures.WEB_FEATURES_FLAG[message.payments] : message.payments; + if (message.stickerPackQuery != null && message.hasOwnProperty("stickerPackQuery")) + object.stickerPackQuery = options.enums === String ? $root.proto.WebFeatures.WEB_FEATURES_FLAG[message.stickerPackQuery] : message.stickerPackQuery; + if (message.liveLocationsFinal != null && message.hasOwnProperty("liveLocationsFinal")) + object.liveLocationsFinal = options.enums === String ? $root.proto.WebFeatures.WEB_FEATURES_FLAG[message.liveLocationsFinal] : message.liveLocationsFinal; + if (message.labelsEdit != null && message.hasOwnProperty("labelsEdit")) + object.labelsEdit = options.enums === String ? $root.proto.WebFeatures.WEB_FEATURES_FLAG[message.labelsEdit] : message.labelsEdit; + if (message.mediaUpload != null && message.hasOwnProperty("mediaUpload")) + object.mediaUpload = options.enums === String ? $root.proto.WebFeatures.WEB_FEATURES_FLAG[message.mediaUpload] : message.mediaUpload; + if (message.mediaUploadRichQuickReplies != null && message.hasOwnProperty("mediaUploadRichQuickReplies")) + object.mediaUploadRichQuickReplies = options.enums === String ? $root.proto.WebFeatures.WEB_FEATURES_FLAG[message.mediaUploadRichQuickReplies] : message.mediaUploadRichQuickReplies; + if (message.vnameV2 != null && message.hasOwnProperty("vnameV2")) + object.vnameV2 = options.enums === String ? $root.proto.WebFeatures.WEB_FEATURES_FLAG[message.vnameV2] : message.vnameV2; + if (message.videoPlaybackUrl != null && message.hasOwnProperty("videoPlaybackUrl")) + object.videoPlaybackUrl = options.enums === String ? $root.proto.WebFeatures.WEB_FEATURES_FLAG[message.videoPlaybackUrl] : message.videoPlaybackUrl; + if (message.statusRanking != null && message.hasOwnProperty("statusRanking")) + object.statusRanking = options.enums === String ? $root.proto.WebFeatures.WEB_FEATURES_FLAG[message.statusRanking] : message.statusRanking; + if (message.voipIndividualVideo != null && message.hasOwnProperty("voipIndividualVideo")) + object.voipIndividualVideo = options.enums === String ? $root.proto.WebFeatures.WEB_FEATURES_FLAG[message.voipIndividualVideo] : message.voipIndividualVideo; + if (message.thirdPartyStickers != null && message.hasOwnProperty("thirdPartyStickers")) + object.thirdPartyStickers = options.enums === String ? $root.proto.WebFeatures.WEB_FEATURES_FLAG[message.thirdPartyStickers] : message.thirdPartyStickers; + if (message.frequentlyForwardedSetting != null && message.hasOwnProperty("frequentlyForwardedSetting")) + object.frequentlyForwardedSetting = options.enums === String ? $root.proto.WebFeatures.WEB_FEATURES_FLAG[message.frequentlyForwardedSetting] : message.frequentlyForwardedSetting; + if (message.groupsV4JoinPermission != null && message.hasOwnProperty("groupsV4JoinPermission")) + object.groupsV4JoinPermission = options.enums === String ? $root.proto.WebFeatures.WEB_FEATURES_FLAG[message.groupsV4JoinPermission] : message.groupsV4JoinPermission; + if (message.recentStickers != null && message.hasOwnProperty("recentStickers")) + object.recentStickers = options.enums === String ? $root.proto.WebFeatures.WEB_FEATURES_FLAG[message.recentStickers] : message.recentStickers; + if (message.catalog != null && message.hasOwnProperty("catalog")) + object.catalog = options.enums === String ? $root.proto.WebFeatures.WEB_FEATURES_FLAG[message.catalog] : message.catalog; + if (message.starredStickers != null && message.hasOwnProperty("starredStickers")) + object.starredStickers = options.enums === String ? $root.proto.WebFeatures.WEB_FEATURES_FLAG[message.starredStickers] : message.starredStickers; + if (message.voipGroupCall != null && message.hasOwnProperty("voipGroupCall")) + object.voipGroupCall = options.enums === String ? $root.proto.WebFeatures.WEB_FEATURES_FLAG[message.voipGroupCall] : message.voipGroupCall; + if (message.templateMessage != null && message.hasOwnProperty("templateMessage")) + object.templateMessage = options.enums === String ? $root.proto.WebFeatures.WEB_FEATURES_FLAG[message.templateMessage] : message.templateMessage; + if (message.templateMessageInteractivity != null && message.hasOwnProperty("templateMessageInteractivity")) + object.templateMessageInteractivity = options.enums === String ? $root.proto.WebFeatures.WEB_FEATURES_FLAG[message.templateMessageInteractivity] : message.templateMessageInteractivity; + if (message.ephemeralMessages != null && message.hasOwnProperty("ephemeralMessages")) + object.ephemeralMessages = options.enums === String ? $root.proto.WebFeatures.WEB_FEATURES_FLAG[message.ephemeralMessages] : message.ephemeralMessages; + return object; + }; + + /** + * Converts this WebFeatures to JSON. + * @function toJSON + * @memberof proto.WebFeatures + * @instance + * @returns {Object.} JSON object + */ + WebFeatures.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * WEB_FEATURES_FLAG enum. + * @name proto.WebFeatures.WEB_FEATURES_FLAG + * @enum {number} + * @property {number} NOT_STARTED=0 NOT_STARTED value + * @property {number} FORCE_UPGRADE=1 FORCE_UPGRADE value + * @property {number} DEVELOPMENT=2 DEVELOPMENT value + * @property {number} PRODUCTION=3 PRODUCTION value + */ + WebFeatures.WEB_FEATURES_FLAG = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NOT_STARTED"] = 0; + values[valuesById[1] = "FORCE_UPGRADE"] = 1; + values[valuesById[2] = "DEVELOPMENT"] = 2; + values[valuesById[3] = "PRODUCTION"] = 3; + return values; + })(); + + return WebFeatures; + })(); + + proto.TabletNotificationsInfo = (function() { + + /** + * Properties of a TabletNotificationsInfo. + * @memberof proto + * @interface ITabletNotificationsInfo + * @property {number|Long|null} [timestamp] TabletNotificationsInfo timestamp + * @property {number|null} [unreadChats] TabletNotificationsInfo unreadChats + * @property {number|null} [notifyMessageCount] TabletNotificationsInfo notifyMessageCount + * @property {Array.|null} [notifyMessage] TabletNotificationsInfo notifyMessage + */ + + /** + * Constructs a new TabletNotificationsInfo. + * @memberof proto + * @classdesc Represents a TabletNotificationsInfo. + * @implements ITabletNotificationsInfo + * @constructor + * @param {proto.ITabletNotificationsInfo=} [properties] Properties to set + */ + function TabletNotificationsInfo(properties) { + this.notifyMessage = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TabletNotificationsInfo timestamp. + * @member {number|Long} timestamp + * @memberof proto.TabletNotificationsInfo + * @instance + */ + TabletNotificationsInfo.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * TabletNotificationsInfo unreadChats. + * @member {number} unreadChats + * @memberof proto.TabletNotificationsInfo + * @instance + */ + TabletNotificationsInfo.prototype.unreadChats = 0; + + /** + * TabletNotificationsInfo notifyMessageCount. + * @member {number} notifyMessageCount + * @memberof proto.TabletNotificationsInfo + * @instance + */ + TabletNotificationsInfo.prototype.notifyMessageCount = 0; + + /** + * TabletNotificationsInfo notifyMessage. + * @member {Array.} notifyMessage + * @memberof proto.TabletNotificationsInfo + * @instance + */ + TabletNotificationsInfo.prototype.notifyMessage = $util.emptyArray; + + /** + * Creates a new TabletNotificationsInfo instance using the specified properties. + * @function create + * @memberof proto.TabletNotificationsInfo + * @static + * @param {proto.ITabletNotificationsInfo=} [properties] Properties to set + * @returns {proto.TabletNotificationsInfo} TabletNotificationsInfo instance + */ + TabletNotificationsInfo.create = function create(properties) { + return new TabletNotificationsInfo(properties); + }; + + /** + * Encodes the specified TabletNotificationsInfo message. Does not implicitly {@link proto.TabletNotificationsInfo.verify|verify} messages. + * @function encode + * @memberof proto.TabletNotificationsInfo + * @static + * @param {proto.ITabletNotificationsInfo} message TabletNotificationsInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TabletNotificationsInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.timestamp); + if (message.unreadChats != null && Object.hasOwnProperty.call(message, "unreadChats")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.unreadChats); + if (message.notifyMessageCount != null && Object.hasOwnProperty.call(message, "notifyMessageCount")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.notifyMessageCount); + if (message.notifyMessage != null && message.notifyMessage.length) + for (var i = 0; i < message.notifyMessage.length; ++i) + $root.proto.NotificationMessageInfo.encode(message.notifyMessage[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TabletNotificationsInfo message, length delimited. Does not implicitly {@link proto.TabletNotificationsInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.TabletNotificationsInfo + * @static + * @param {proto.ITabletNotificationsInfo} message TabletNotificationsInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TabletNotificationsInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TabletNotificationsInfo message from the specified reader or buffer. + * @function decode + * @memberof proto.TabletNotificationsInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.TabletNotificationsInfo} TabletNotificationsInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TabletNotificationsInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.TabletNotificationsInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.timestamp = reader.uint64(); + break; + case 3: + message.unreadChats = reader.uint32(); + break; + case 4: + message.notifyMessageCount = reader.uint32(); + break; + case 5: + if (!(message.notifyMessage && message.notifyMessage.length)) + message.notifyMessage = []; + message.notifyMessage.push($root.proto.NotificationMessageInfo.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TabletNotificationsInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.TabletNotificationsInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.TabletNotificationsInfo} TabletNotificationsInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TabletNotificationsInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TabletNotificationsInfo message. + * @function verify + * @memberof proto.TabletNotificationsInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TabletNotificationsInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high))) + return "timestamp: integer|Long expected"; + if (message.unreadChats != null && message.hasOwnProperty("unreadChats")) + if (!$util.isInteger(message.unreadChats)) + return "unreadChats: integer expected"; + if (message.notifyMessageCount != null && message.hasOwnProperty("notifyMessageCount")) + if (!$util.isInteger(message.notifyMessageCount)) + return "notifyMessageCount: integer expected"; + if (message.notifyMessage != null && message.hasOwnProperty("notifyMessage")) { + if (!Array.isArray(message.notifyMessage)) + return "notifyMessage: array expected"; + for (var i = 0; i < message.notifyMessage.length; ++i) { + var error = $root.proto.NotificationMessageInfo.verify(message.notifyMessage[i]); + if (error) + return "notifyMessage." + error; + } + } + return null; + }; + + /** + * Creates a TabletNotificationsInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.TabletNotificationsInfo + * @static + * @param {Object.} object Plain object + * @returns {proto.TabletNotificationsInfo} TabletNotificationsInfo + */ + TabletNotificationsInfo.fromObject = function fromObject(object) { + if (object instanceof $root.proto.TabletNotificationsInfo) + return object; + var message = new $root.proto.TabletNotificationsInfo(); + if (object.timestamp != null) + if ($util.Long) + (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = true; + else if (typeof object.timestamp === "string") + message.timestamp = parseInt(object.timestamp, 10); + else if (typeof object.timestamp === "number") + message.timestamp = object.timestamp; + else if (typeof object.timestamp === "object") + message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(true); + if (object.unreadChats != null) + message.unreadChats = object.unreadChats >>> 0; + if (object.notifyMessageCount != null) + message.notifyMessageCount = object.notifyMessageCount >>> 0; + if (object.notifyMessage) { + if (!Array.isArray(object.notifyMessage)) + throw TypeError(".proto.TabletNotificationsInfo.notifyMessage: array expected"); + message.notifyMessage = []; + for (var i = 0; i < object.notifyMessage.length; ++i) { + if (typeof object.notifyMessage[i] !== "object") + throw TypeError(".proto.TabletNotificationsInfo.notifyMessage: object expected"); + message.notifyMessage[i] = $root.proto.NotificationMessageInfo.fromObject(object.notifyMessage[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TabletNotificationsInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.TabletNotificationsInfo + * @static + * @param {proto.TabletNotificationsInfo} message TabletNotificationsInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TabletNotificationsInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.notifyMessage = []; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.timestamp = options.longs === String ? "0" : 0; + object.unreadChats = 0; + object.notifyMessageCount = 0; + } + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + if (typeof message.timestamp === "number") + object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp; + else + object.timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp) : options.longs === Number ? new $util.LongBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0).toNumber(true) : message.timestamp; + if (message.unreadChats != null && message.hasOwnProperty("unreadChats")) + object.unreadChats = message.unreadChats; + if (message.notifyMessageCount != null && message.hasOwnProperty("notifyMessageCount")) + object.notifyMessageCount = message.notifyMessageCount; + if (message.notifyMessage && message.notifyMessage.length) { + object.notifyMessage = []; + for (var j = 0; j < message.notifyMessage.length; ++j) + object.notifyMessage[j] = $root.proto.NotificationMessageInfo.toObject(message.notifyMessage[j], options); + } + return object; + }; + + /** + * Converts this TabletNotificationsInfo to JSON. + * @function toJSON + * @memberof proto.TabletNotificationsInfo + * @instance + * @returns {Object.} JSON object + */ + TabletNotificationsInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TabletNotificationsInfo; + })(); + + proto.NotificationMessageInfo = (function() { + + /** + * Properties of a NotificationMessageInfo. + * @memberof proto + * @interface INotificationMessageInfo + * @property {proto.IMessageKey|null} [key] NotificationMessageInfo key + * @property {proto.IMessage|null} [message] NotificationMessageInfo message + * @property {number|Long|null} [messageTimestamp] NotificationMessageInfo messageTimestamp + * @property {string|null} [participant] NotificationMessageInfo participant + */ + + /** + * Constructs a new NotificationMessageInfo. + * @memberof proto + * @classdesc Represents a NotificationMessageInfo. + * @implements INotificationMessageInfo + * @constructor + * @param {proto.INotificationMessageInfo=} [properties] Properties to set + */ + function NotificationMessageInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NotificationMessageInfo key. + * @member {proto.IMessageKey|null|undefined} key + * @memberof proto.NotificationMessageInfo + * @instance + */ + NotificationMessageInfo.prototype.key = null; + + /** + * NotificationMessageInfo message. + * @member {proto.IMessage|null|undefined} message + * @memberof proto.NotificationMessageInfo + * @instance + */ + NotificationMessageInfo.prototype.message = null; + + /** + * NotificationMessageInfo messageTimestamp. + * @member {number|Long} messageTimestamp + * @memberof proto.NotificationMessageInfo + * @instance + */ + NotificationMessageInfo.prototype.messageTimestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * NotificationMessageInfo participant. + * @member {string} participant + * @memberof proto.NotificationMessageInfo + * @instance + */ + NotificationMessageInfo.prototype.participant = ""; + + /** + * Creates a new NotificationMessageInfo instance using the specified properties. + * @function create + * @memberof proto.NotificationMessageInfo + * @static + * @param {proto.INotificationMessageInfo=} [properties] Properties to set + * @returns {proto.NotificationMessageInfo} NotificationMessageInfo instance + */ + NotificationMessageInfo.create = function create(properties) { + return new NotificationMessageInfo(properties); + }; + + /** + * Encodes the specified NotificationMessageInfo message. Does not implicitly {@link proto.NotificationMessageInfo.verify|verify} messages. + * @function encode + * @memberof proto.NotificationMessageInfo + * @static + * @param {proto.INotificationMessageInfo} message NotificationMessageInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NotificationMessageInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + $root.proto.MessageKey.encode(message.key, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + $root.proto.Message.encode(message.message, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.messageTimestamp != null && Object.hasOwnProperty.call(message, "messageTimestamp")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.messageTimestamp); + if (message.participant != null && Object.hasOwnProperty.call(message, "participant")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.participant); + return writer; + }; + + /** + * Encodes the specified NotificationMessageInfo message, length delimited. Does not implicitly {@link proto.NotificationMessageInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.NotificationMessageInfo + * @static + * @param {proto.INotificationMessageInfo} message NotificationMessageInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NotificationMessageInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NotificationMessageInfo message from the specified reader or buffer. + * @function decode + * @memberof proto.NotificationMessageInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.NotificationMessageInfo} NotificationMessageInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NotificationMessageInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.NotificationMessageInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = $root.proto.MessageKey.decode(reader, reader.uint32()); + break; + case 2: + message.message = $root.proto.Message.decode(reader, reader.uint32()); + break; + case 3: + message.messageTimestamp = reader.uint64(); + break; + case 4: + message.participant = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NotificationMessageInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.NotificationMessageInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.NotificationMessageInfo} NotificationMessageInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NotificationMessageInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NotificationMessageInfo message. + * @function verify + * @memberof proto.NotificationMessageInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NotificationMessageInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) { + var error = $root.proto.MessageKey.verify(message.key); + if (error) + return "key." + error; + } + if (message.message != null && message.hasOwnProperty("message")) { + var error = $root.proto.Message.verify(message.message); + if (error) + return "message." + error; + } + if (message.messageTimestamp != null && message.hasOwnProperty("messageTimestamp")) + if (!$util.isInteger(message.messageTimestamp) && !(message.messageTimestamp && $util.isInteger(message.messageTimestamp.low) && $util.isInteger(message.messageTimestamp.high))) + return "messageTimestamp: integer|Long expected"; + if (message.participant != null && message.hasOwnProperty("participant")) + if (!$util.isString(message.participant)) + return "participant: string expected"; + return null; + }; + + /** + * Creates a NotificationMessageInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.NotificationMessageInfo + * @static + * @param {Object.} object Plain object + * @returns {proto.NotificationMessageInfo} NotificationMessageInfo + */ + NotificationMessageInfo.fromObject = function fromObject(object) { + if (object instanceof $root.proto.NotificationMessageInfo) + return object; + var message = new $root.proto.NotificationMessageInfo(); + if (object.key != null) { + if (typeof object.key !== "object") + throw TypeError(".proto.NotificationMessageInfo.key: object expected"); + message.key = $root.proto.MessageKey.fromObject(object.key); + } + if (object.message != null) { + if (typeof object.message !== "object") + throw TypeError(".proto.NotificationMessageInfo.message: object expected"); + message.message = $root.proto.Message.fromObject(object.message); + } + if (object.messageTimestamp != null) + if ($util.Long) + (message.messageTimestamp = $util.Long.fromValue(object.messageTimestamp)).unsigned = true; + else if (typeof object.messageTimestamp === "string") + message.messageTimestamp = parseInt(object.messageTimestamp, 10); + else if (typeof object.messageTimestamp === "number") + message.messageTimestamp = object.messageTimestamp; + else if (typeof object.messageTimestamp === "object") + message.messageTimestamp = new $util.LongBits(object.messageTimestamp.low >>> 0, object.messageTimestamp.high >>> 0).toNumber(true); + if (object.participant != null) + message.participant = String(object.participant); + return message; + }; + + /** + * Creates a plain object from a NotificationMessageInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.NotificationMessageInfo + * @static + * @param {proto.NotificationMessageInfo} message NotificationMessageInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NotificationMessageInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.key = null; + object.message = null; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.messageTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.messageTimestamp = options.longs === String ? "0" : 0; + object.participant = ""; + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = $root.proto.MessageKey.toObject(message.key, options); + if (message.message != null && message.hasOwnProperty("message")) + object.message = $root.proto.Message.toObject(message.message, options); + if (message.messageTimestamp != null && message.hasOwnProperty("messageTimestamp")) + if (typeof message.messageTimestamp === "number") + object.messageTimestamp = options.longs === String ? String(message.messageTimestamp) : message.messageTimestamp; + else + object.messageTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.messageTimestamp) : options.longs === Number ? new $util.LongBits(message.messageTimestamp.low >>> 0, message.messageTimestamp.high >>> 0).toNumber(true) : message.messageTimestamp; + if (message.participant != null && message.hasOwnProperty("participant")) + object.participant = message.participant; + return object; + }; + + /** + * Converts this NotificationMessageInfo to JSON. + * @function toJSON + * @memberof proto.NotificationMessageInfo + * @instance + * @returns {Object.} JSON object + */ + NotificationMessageInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return NotificationMessageInfo; + })(); + + proto.WebNotificationsInfo = (function() { + + /** + * Properties of a WebNotificationsInfo. + * @memberof proto + * @interface IWebNotificationsInfo + * @property {number|Long|null} [timestamp] WebNotificationsInfo timestamp + * @property {number|null} [unreadChats] WebNotificationsInfo unreadChats + * @property {number|null} [notifyMessageCount] WebNotificationsInfo notifyMessageCount + * @property {Array.|null} [notifyMessages] WebNotificationsInfo notifyMessages + */ + + /** + * Constructs a new WebNotificationsInfo. + * @memberof proto + * @classdesc Represents a WebNotificationsInfo. + * @implements IWebNotificationsInfo + * @constructor + * @param {proto.IWebNotificationsInfo=} [properties] Properties to set + */ + function WebNotificationsInfo(properties) { + this.notifyMessages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WebNotificationsInfo timestamp. + * @member {number|Long} timestamp + * @memberof proto.WebNotificationsInfo + * @instance + */ + WebNotificationsInfo.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * WebNotificationsInfo unreadChats. + * @member {number} unreadChats + * @memberof proto.WebNotificationsInfo + * @instance + */ + WebNotificationsInfo.prototype.unreadChats = 0; + + /** + * WebNotificationsInfo notifyMessageCount. + * @member {number} notifyMessageCount + * @memberof proto.WebNotificationsInfo + * @instance + */ + WebNotificationsInfo.prototype.notifyMessageCount = 0; + + /** + * WebNotificationsInfo notifyMessages. + * @member {Array.} notifyMessages + * @memberof proto.WebNotificationsInfo + * @instance + */ + WebNotificationsInfo.prototype.notifyMessages = $util.emptyArray; + + /** + * Creates a new WebNotificationsInfo instance using the specified properties. + * @function create + * @memberof proto.WebNotificationsInfo + * @static + * @param {proto.IWebNotificationsInfo=} [properties] Properties to set + * @returns {proto.WebNotificationsInfo} WebNotificationsInfo instance + */ + WebNotificationsInfo.create = function create(properties) { + return new WebNotificationsInfo(properties); + }; + + /** + * Encodes the specified WebNotificationsInfo message. Does not implicitly {@link proto.WebNotificationsInfo.verify|verify} messages. + * @function encode + * @memberof proto.WebNotificationsInfo + * @static + * @param {proto.IWebNotificationsInfo} message WebNotificationsInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebNotificationsInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.timestamp); + if (message.unreadChats != null && Object.hasOwnProperty.call(message, "unreadChats")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.unreadChats); + if (message.notifyMessageCount != null && Object.hasOwnProperty.call(message, "notifyMessageCount")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.notifyMessageCount); + if (message.notifyMessages != null && message.notifyMessages.length) + for (var i = 0; i < message.notifyMessages.length; ++i) + $root.proto.WebMessageInfo.encode(message.notifyMessages[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WebNotificationsInfo message, length delimited. Does not implicitly {@link proto.WebNotificationsInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.WebNotificationsInfo + * @static + * @param {proto.IWebNotificationsInfo} message WebNotificationsInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebNotificationsInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WebNotificationsInfo message from the specified reader or buffer. + * @function decode + * @memberof proto.WebNotificationsInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.WebNotificationsInfo} WebNotificationsInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebNotificationsInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.WebNotificationsInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.timestamp = reader.uint64(); + break; + case 3: + message.unreadChats = reader.uint32(); + break; + case 4: + message.notifyMessageCount = reader.uint32(); + break; + case 5: + if (!(message.notifyMessages && message.notifyMessages.length)) + message.notifyMessages = []; + message.notifyMessages.push($root.proto.WebMessageInfo.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WebNotificationsInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.WebNotificationsInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.WebNotificationsInfo} WebNotificationsInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebNotificationsInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WebNotificationsInfo message. + * @function verify + * @memberof proto.WebNotificationsInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WebNotificationsInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high))) + return "timestamp: integer|Long expected"; + if (message.unreadChats != null && message.hasOwnProperty("unreadChats")) + if (!$util.isInteger(message.unreadChats)) + return "unreadChats: integer expected"; + if (message.notifyMessageCount != null && message.hasOwnProperty("notifyMessageCount")) + if (!$util.isInteger(message.notifyMessageCount)) + return "notifyMessageCount: integer expected"; + if (message.notifyMessages != null && message.hasOwnProperty("notifyMessages")) { + if (!Array.isArray(message.notifyMessages)) + return "notifyMessages: array expected"; + for (var i = 0; i < message.notifyMessages.length; ++i) { + var error = $root.proto.WebMessageInfo.verify(message.notifyMessages[i]); + if (error) + return "notifyMessages." + error; + } + } + return null; + }; + + /** + * Creates a WebNotificationsInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.WebNotificationsInfo + * @static + * @param {Object.} object Plain object + * @returns {proto.WebNotificationsInfo} WebNotificationsInfo + */ + WebNotificationsInfo.fromObject = function fromObject(object) { + if (object instanceof $root.proto.WebNotificationsInfo) + return object; + var message = new $root.proto.WebNotificationsInfo(); + if (object.timestamp != null) + if ($util.Long) + (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = true; + else if (typeof object.timestamp === "string") + message.timestamp = parseInt(object.timestamp, 10); + else if (typeof object.timestamp === "number") + message.timestamp = object.timestamp; + else if (typeof object.timestamp === "object") + message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(true); + if (object.unreadChats != null) + message.unreadChats = object.unreadChats >>> 0; + if (object.notifyMessageCount != null) + message.notifyMessageCount = object.notifyMessageCount >>> 0; + if (object.notifyMessages) { + if (!Array.isArray(object.notifyMessages)) + throw TypeError(".proto.WebNotificationsInfo.notifyMessages: array expected"); + message.notifyMessages = []; + for (var i = 0; i < object.notifyMessages.length; ++i) { + if (typeof object.notifyMessages[i] !== "object") + throw TypeError(".proto.WebNotificationsInfo.notifyMessages: object expected"); + message.notifyMessages[i] = $root.proto.WebMessageInfo.fromObject(object.notifyMessages[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a WebNotificationsInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.WebNotificationsInfo + * @static + * @param {proto.WebNotificationsInfo} message WebNotificationsInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WebNotificationsInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.notifyMessages = []; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.timestamp = options.longs === String ? "0" : 0; + object.unreadChats = 0; + object.notifyMessageCount = 0; + } + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + if (typeof message.timestamp === "number") + object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp; + else + object.timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp) : options.longs === Number ? new $util.LongBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0).toNumber(true) : message.timestamp; + if (message.unreadChats != null && message.hasOwnProperty("unreadChats")) + object.unreadChats = message.unreadChats; + if (message.notifyMessageCount != null && message.hasOwnProperty("notifyMessageCount")) + object.notifyMessageCount = message.notifyMessageCount; + if (message.notifyMessages && message.notifyMessages.length) { + object.notifyMessages = []; + for (var j = 0; j < message.notifyMessages.length; ++j) + object.notifyMessages[j] = $root.proto.WebMessageInfo.toObject(message.notifyMessages[j], options); + } + return object; + }; + + /** + * Converts this WebNotificationsInfo to JSON. + * @function toJSON + * @memberof proto.WebNotificationsInfo + * @instance + * @returns {Object.} JSON object + */ + WebNotificationsInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return WebNotificationsInfo; + })(); + + proto.PaymentInfo = (function() { + + /** + * Properties of a PaymentInfo. + * @memberof proto + * @interface IPaymentInfo + * @property {number|Long|null} [amount1000] PaymentInfo amount1000 + * @property {string|null} [receiverJid] PaymentInfo receiverJid + * @property {proto.PaymentInfo.PAYMENT_INFO_STATUS|null} [status] PaymentInfo status + * @property {number|Long|null} [transactionTimestamp] PaymentInfo transactionTimestamp + * @property {proto.IMessageKey|null} [requestMessageKey] PaymentInfo requestMessageKey + * @property {number|Long|null} [expiryTimestamp] PaymentInfo expiryTimestamp + * @property {boolean|null} [futureproofed] PaymentInfo futureproofed + * @property {string|null} [currency] PaymentInfo currency + */ + + /** + * Constructs a new PaymentInfo. + * @memberof proto + * @classdesc Represents a PaymentInfo. + * @implements IPaymentInfo + * @constructor + * @param {proto.IPaymentInfo=} [properties] Properties to set + */ + function PaymentInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PaymentInfo amount1000. + * @member {number|Long} amount1000 + * @memberof proto.PaymentInfo + * @instance + */ + PaymentInfo.prototype.amount1000 = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * PaymentInfo receiverJid. + * @member {string} receiverJid + * @memberof proto.PaymentInfo + * @instance + */ + PaymentInfo.prototype.receiverJid = ""; + + /** + * PaymentInfo status. + * @member {proto.PaymentInfo.PAYMENT_INFO_STATUS} status + * @memberof proto.PaymentInfo + * @instance + */ + PaymentInfo.prototype.status = 0; + + /** + * PaymentInfo transactionTimestamp. + * @member {number|Long} transactionTimestamp + * @memberof proto.PaymentInfo + * @instance + */ + PaymentInfo.prototype.transactionTimestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * PaymentInfo requestMessageKey. + * @member {proto.IMessageKey|null|undefined} requestMessageKey + * @memberof proto.PaymentInfo + * @instance + */ + PaymentInfo.prototype.requestMessageKey = null; + + /** + * PaymentInfo expiryTimestamp. + * @member {number|Long} expiryTimestamp + * @memberof proto.PaymentInfo + * @instance + */ + PaymentInfo.prototype.expiryTimestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * PaymentInfo futureproofed. + * @member {boolean} futureproofed + * @memberof proto.PaymentInfo + * @instance + */ + PaymentInfo.prototype.futureproofed = false; + + /** + * PaymentInfo currency. + * @member {string} currency + * @memberof proto.PaymentInfo + * @instance + */ + PaymentInfo.prototype.currency = ""; + + /** + * Creates a new PaymentInfo instance using the specified properties. + * @function create + * @memberof proto.PaymentInfo + * @static + * @param {proto.IPaymentInfo=} [properties] Properties to set + * @returns {proto.PaymentInfo} PaymentInfo instance + */ + PaymentInfo.create = function create(properties) { + return new PaymentInfo(properties); + }; + + /** + * Encodes the specified PaymentInfo message. Does not implicitly {@link proto.PaymentInfo.verify|verify} messages. + * @function encode + * @memberof proto.PaymentInfo + * @static + * @param {proto.IPaymentInfo} message PaymentInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PaymentInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.amount1000 != null && Object.hasOwnProperty.call(message, "amount1000")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.amount1000); + if (message.receiverJid != null && Object.hasOwnProperty.call(message, "receiverJid")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.receiverJid); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.status); + if (message.transactionTimestamp != null && Object.hasOwnProperty.call(message, "transactionTimestamp")) + writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.transactionTimestamp); + if (message.requestMessageKey != null && Object.hasOwnProperty.call(message, "requestMessageKey")) + $root.proto.MessageKey.encode(message.requestMessageKey, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.expiryTimestamp != null && Object.hasOwnProperty.call(message, "expiryTimestamp")) + writer.uint32(/* id 7, wireType 0 =*/56).uint64(message.expiryTimestamp); + if (message.futureproofed != null && Object.hasOwnProperty.call(message, "futureproofed")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.futureproofed); + if (message.currency != null && Object.hasOwnProperty.call(message, "currency")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.currency); + return writer; + }; + + /** + * Encodes the specified PaymentInfo message, length delimited. Does not implicitly {@link proto.PaymentInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.PaymentInfo + * @static + * @param {proto.IPaymentInfo} message PaymentInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PaymentInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PaymentInfo message from the specified reader or buffer. + * @function decode + * @memberof proto.PaymentInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.PaymentInfo} PaymentInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PaymentInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.PaymentInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.amount1000 = reader.uint64(); + break; + case 3: + message.receiverJid = reader.string(); + break; + case 4: + message.status = reader.int32(); + break; + case 5: + message.transactionTimestamp = reader.uint64(); + break; + case 6: + message.requestMessageKey = $root.proto.MessageKey.decode(reader, reader.uint32()); + break; + case 7: + message.expiryTimestamp = reader.uint64(); + break; + case 8: + message.futureproofed = reader.bool(); + break; + case 9: + message.currency = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PaymentInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.PaymentInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.PaymentInfo} PaymentInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PaymentInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PaymentInfo message. + * @function verify + * @memberof proto.PaymentInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PaymentInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.amount1000 != null && message.hasOwnProperty("amount1000")) + if (!$util.isInteger(message.amount1000) && !(message.amount1000 && $util.isInteger(message.amount1000.low) && $util.isInteger(message.amount1000.high))) + return "amount1000: integer|Long expected"; + if (message.receiverJid != null && message.hasOwnProperty("receiverJid")) + if (!$util.isString(message.receiverJid)) + return "receiverJid: string expected"; + if (message.status != null && message.hasOwnProperty("status")) + switch (message.status) { + default: + return "status: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + break; + } + if (message.transactionTimestamp != null && message.hasOwnProperty("transactionTimestamp")) + if (!$util.isInteger(message.transactionTimestamp) && !(message.transactionTimestamp && $util.isInteger(message.transactionTimestamp.low) && $util.isInteger(message.transactionTimestamp.high))) + return "transactionTimestamp: integer|Long expected"; + if (message.requestMessageKey != null && message.hasOwnProperty("requestMessageKey")) { + var error = $root.proto.MessageKey.verify(message.requestMessageKey); + if (error) + return "requestMessageKey." + error; + } + if (message.expiryTimestamp != null && message.hasOwnProperty("expiryTimestamp")) + if (!$util.isInteger(message.expiryTimestamp) && !(message.expiryTimestamp && $util.isInteger(message.expiryTimestamp.low) && $util.isInteger(message.expiryTimestamp.high))) + return "expiryTimestamp: integer|Long expected"; + if (message.futureproofed != null && message.hasOwnProperty("futureproofed")) + if (typeof message.futureproofed !== "boolean") + return "futureproofed: boolean expected"; + if (message.currency != null && message.hasOwnProperty("currency")) + if (!$util.isString(message.currency)) + return "currency: string expected"; + return null; + }; + + /** + * Creates a PaymentInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.PaymentInfo + * @static + * @param {Object.} object Plain object + * @returns {proto.PaymentInfo} PaymentInfo + */ + PaymentInfo.fromObject = function fromObject(object) { + if (object instanceof $root.proto.PaymentInfo) + return object; + var message = new $root.proto.PaymentInfo(); + if (object.amount1000 != null) + if ($util.Long) + (message.amount1000 = $util.Long.fromValue(object.amount1000)).unsigned = true; + else if (typeof object.amount1000 === "string") + message.amount1000 = parseInt(object.amount1000, 10); + else if (typeof object.amount1000 === "number") + message.amount1000 = object.amount1000; + else if (typeof object.amount1000 === "object") + message.amount1000 = new $util.LongBits(object.amount1000.low >>> 0, object.amount1000.high >>> 0).toNumber(true); + if (object.receiverJid != null) + message.receiverJid = String(object.receiverJid); + switch (object.status) { + case "UNKNOWN_STATUS": + case 0: + message.status = 0; + break; + case "PROCESSING": + case 1: + message.status = 1; + break; + case "SENT": + case 2: + message.status = 2; + break; + case "NEED_TO_ACCEPT": + case 3: + message.status = 3; + break; + case "COMPLETE": + case 4: + message.status = 4; + break; + case "COULD_NOT_COMPLETE": + case 5: + message.status = 5; + break; + case "REFUNDED": + case 6: + message.status = 6; + break; + case "EXPIRED": + case 7: + message.status = 7; + break; + case "REJECTED": + case 8: + message.status = 8; + break; + case "CANCELLED": + case 9: + message.status = 9; + break; + case "WAITING_FOR_PAYER": + case 10: + message.status = 10; + break; + case "WAITING": + case 11: + message.status = 11; + break; + } + if (object.transactionTimestamp != null) + if ($util.Long) + (message.transactionTimestamp = $util.Long.fromValue(object.transactionTimestamp)).unsigned = true; + else if (typeof object.transactionTimestamp === "string") + message.transactionTimestamp = parseInt(object.transactionTimestamp, 10); + else if (typeof object.transactionTimestamp === "number") + message.transactionTimestamp = object.transactionTimestamp; + else if (typeof object.transactionTimestamp === "object") + message.transactionTimestamp = new $util.LongBits(object.transactionTimestamp.low >>> 0, object.transactionTimestamp.high >>> 0).toNumber(true); + if (object.requestMessageKey != null) { + if (typeof object.requestMessageKey !== "object") + throw TypeError(".proto.PaymentInfo.requestMessageKey: object expected"); + message.requestMessageKey = $root.proto.MessageKey.fromObject(object.requestMessageKey); + } + if (object.expiryTimestamp != null) + if ($util.Long) + (message.expiryTimestamp = $util.Long.fromValue(object.expiryTimestamp)).unsigned = true; + else if (typeof object.expiryTimestamp === "string") + message.expiryTimestamp = parseInt(object.expiryTimestamp, 10); + else if (typeof object.expiryTimestamp === "number") + message.expiryTimestamp = object.expiryTimestamp; + else if (typeof object.expiryTimestamp === "object") + message.expiryTimestamp = new $util.LongBits(object.expiryTimestamp.low >>> 0, object.expiryTimestamp.high >>> 0).toNumber(true); + if (object.futureproofed != null) + message.futureproofed = Boolean(object.futureproofed); + if (object.currency != null) + message.currency = String(object.currency); + return message; + }; + + /** + * Creates a plain object from a PaymentInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.PaymentInfo + * @static + * @param {proto.PaymentInfo} message PaymentInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PaymentInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.amount1000 = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.amount1000 = options.longs === String ? "0" : 0; + object.receiverJid = ""; + object.status = options.enums === String ? "UNKNOWN_STATUS" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.transactionTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.transactionTimestamp = options.longs === String ? "0" : 0; + object.requestMessageKey = null; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.expiryTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.expiryTimestamp = options.longs === String ? "0" : 0; + object.futureproofed = false; + object.currency = ""; + } + if (message.amount1000 != null && message.hasOwnProperty("amount1000")) + if (typeof message.amount1000 === "number") + object.amount1000 = options.longs === String ? String(message.amount1000) : message.amount1000; + else + object.amount1000 = options.longs === String ? $util.Long.prototype.toString.call(message.amount1000) : options.longs === Number ? new $util.LongBits(message.amount1000.low >>> 0, message.amount1000.high >>> 0).toNumber(true) : message.amount1000; + if (message.receiverJid != null && message.hasOwnProperty("receiverJid")) + object.receiverJid = message.receiverJid; + if (message.status != null && message.hasOwnProperty("status")) + object.status = options.enums === String ? $root.proto.PaymentInfo.PAYMENT_INFO_STATUS[message.status] : message.status; + if (message.transactionTimestamp != null && message.hasOwnProperty("transactionTimestamp")) + if (typeof message.transactionTimestamp === "number") + object.transactionTimestamp = options.longs === String ? String(message.transactionTimestamp) : message.transactionTimestamp; + else + object.transactionTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.transactionTimestamp) : options.longs === Number ? new $util.LongBits(message.transactionTimestamp.low >>> 0, message.transactionTimestamp.high >>> 0).toNumber(true) : message.transactionTimestamp; + if (message.requestMessageKey != null && message.hasOwnProperty("requestMessageKey")) + object.requestMessageKey = $root.proto.MessageKey.toObject(message.requestMessageKey, options); + if (message.expiryTimestamp != null && message.hasOwnProperty("expiryTimestamp")) + if (typeof message.expiryTimestamp === "number") + object.expiryTimestamp = options.longs === String ? String(message.expiryTimestamp) : message.expiryTimestamp; + else + object.expiryTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.expiryTimestamp) : options.longs === Number ? new $util.LongBits(message.expiryTimestamp.low >>> 0, message.expiryTimestamp.high >>> 0).toNumber(true) : message.expiryTimestamp; + if (message.futureproofed != null && message.hasOwnProperty("futureproofed")) + object.futureproofed = message.futureproofed; + if (message.currency != null && message.hasOwnProperty("currency")) + object.currency = message.currency; + return object; + }; + + /** + * Converts this PaymentInfo to JSON. + * @function toJSON + * @memberof proto.PaymentInfo + * @instance + * @returns {Object.} JSON object + */ + PaymentInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * PAYMENT_INFO_STATUS enum. + * @name proto.PaymentInfo.PAYMENT_INFO_STATUS + * @enum {number} + * @property {number} UNKNOWN_STATUS=0 UNKNOWN_STATUS value + * @property {number} PROCESSING=1 PROCESSING value + * @property {number} SENT=2 SENT value + * @property {number} NEED_TO_ACCEPT=3 NEED_TO_ACCEPT value + * @property {number} COMPLETE=4 COMPLETE value + * @property {number} COULD_NOT_COMPLETE=5 COULD_NOT_COMPLETE value + * @property {number} REFUNDED=6 REFUNDED value + * @property {number} EXPIRED=7 EXPIRED value + * @property {number} REJECTED=8 REJECTED value + * @property {number} CANCELLED=9 CANCELLED value + * @property {number} WAITING_FOR_PAYER=10 WAITING_FOR_PAYER value + * @property {number} WAITING=11 WAITING value + */ + PaymentInfo.PAYMENT_INFO_STATUS = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN_STATUS"] = 0; + values[valuesById[1] = "PROCESSING"] = 1; + values[valuesById[2] = "SENT"] = 2; + values[valuesById[3] = "NEED_TO_ACCEPT"] = 3; + values[valuesById[4] = "COMPLETE"] = 4; + values[valuesById[5] = "COULD_NOT_COMPLETE"] = 5; + values[valuesById[6] = "REFUNDED"] = 6; + values[valuesById[7] = "EXPIRED"] = 7; + values[valuesById[8] = "REJECTED"] = 8; + values[valuesById[9] = "CANCELLED"] = 9; + values[valuesById[10] = "WAITING_FOR_PAYER"] = 10; + values[valuesById[11] = "WAITING"] = 11; + return values; + })(); + + return PaymentInfo; + })(); + + proto.WebMessageInfo = (function() { + + /** + * Properties of a WebMessageInfo. + * @memberof proto + * @interface IWebMessageInfo + * @property {proto.IMessageKey} key WebMessageInfo key + * @property {proto.IMessage|null} [message] WebMessageInfo message + * @property {number|Long|null} [messageTimestamp] WebMessageInfo messageTimestamp + * @property {proto.WebMessageInfo.WEB_MESSAGE_INFO_STATUS|null} [status] WebMessageInfo status + * @property {string|null} [participant] WebMessageInfo participant + * @property {boolean|null} [ignore] WebMessageInfo ignore + * @property {boolean|null} [starred] WebMessageInfo starred + * @property {boolean|null} [broadcast] WebMessageInfo broadcast + * @property {string|null} [pushName] WebMessageInfo pushName + * @property {Uint8Array|null} [mediaCiphertextSha256] WebMessageInfo mediaCiphertextSha256 + * @property {boolean|null} [multicast] WebMessageInfo multicast + * @property {boolean|null} [urlText] WebMessageInfo urlText + * @property {boolean|null} [urlNumber] WebMessageInfo urlNumber + * @property {proto.WebMessageInfo.WEB_MESSAGE_INFO_STUBTYPE|null} [messageStubType] WebMessageInfo messageStubType + * @property {boolean|null} [clearMedia] WebMessageInfo clearMedia + * @property {Array.|null} [messageStubParameters] WebMessageInfo messageStubParameters + * @property {number|null} [duration] WebMessageInfo duration + * @property {Array.|null} [labels] WebMessageInfo labels + * @property {proto.IPaymentInfo|null} [paymentInfo] WebMessageInfo paymentInfo + * @property {proto.ILiveLocationMessage|null} [finalLiveLocation] WebMessageInfo finalLiveLocation + * @property {proto.IPaymentInfo|null} [quotedPaymentInfo] WebMessageInfo quotedPaymentInfo + * @property {number|Long|null} [ephemeralStartTimestamp] WebMessageInfo ephemeralStartTimestamp + * @property {number|null} [ephemeralDuration] WebMessageInfo ephemeralDuration + */ + + /** + * Constructs a new WebMessageInfo. + * @memberof proto + * @classdesc Represents a WebMessageInfo. + * @implements IWebMessageInfo + * @constructor + * @param {proto.IWebMessageInfo=} [properties] Properties to set + */ + function WebMessageInfo(properties) { + this.messageStubParameters = []; + this.labels = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WebMessageInfo key. + * @member {proto.IMessageKey} key + * @memberof proto.WebMessageInfo + * @instance + */ + WebMessageInfo.prototype.key = null; + + /** + * WebMessageInfo message. + * @member {proto.IMessage|null|undefined} message + * @memberof proto.WebMessageInfo + * @instance + */ + WebMessageInfo.prototype.message = null; + + /** + * WebMessageInfo messageTimestamp. + * @member {number|Long} messageTimestamp + * @memberof proto.WebMessageInfo + * @instance + */ + WebMessageInfo.prototype.messageTimestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * WebMessageInfo status. + * @member {proto.WebMessageInfo.WEB_MESSAGE_INFO_STATUS} status + * @memberof proto.WebMessageInfo + * @instance + */ + WebMessageInfo.prototype.status = 0; + + /** + * WebMessageInfo participant. + * @member {string} participant + * @memberof proto.WebMessageInfo + * @instance + */ + WebMessageInfo.prototype.participant = ""; + + /** + * WebMessageInfo ignore. + * @member {boolean} ignore + * @memberof proto.WebMessageInfo + * @instance + */ + WebMessageInfo.prototype.ignore = false; + + /** + * WebMessageInfo starred. + * @member {boolean} starred + * @memberof proto.WebMessageInfo + * @instance + */ + WebMessageInfo.prototype.starred = false; + + /** + * WebMessageInfo broadcast. + * @member {boolean} broadcast + * @memberof proto.WebMessageInfo + * @instance + */ + WebMessageInfo.prototype.broadcast = false; + + /** + * WebMessageInfo pushName. + * @member {string} pushName + * @memberof proto.WebMessageInfo + * @instance + */ + WebMessageInfo.prototype.pushName = ""; + + /** + * WebMessageInfo mediaCiphertextSha256. + * @member {Uint8Array} mediaCiphertextSha256 + * @memberof proto.WebMessageInfo + * @instance + */ + WebMessageInfo.prototype.mediaCiphertextSha256 = $util.newBuffer([]); + + /** + * WebMessageInfo multicast. + * @member {boolean} multicast + * @memberof proto.WebMessageInfo + * @instance + */ + WebMessageInfo.prototype.multicast = false; + + /** + * WebMessageInfo urlText. + * @member {boolean} urlText + * @memberof proto.WebMessageInfo + * @instance + */ + WebMessageInfo.prototype.urlText = false; + + /** + * WebMessageInfo urlNumber. + * @member {boolean} urlNumber + * @memberof proto.WebMessageInfo + * @instance + */ + WebMessageInfo.prototype.urlNumber = false; + + /** + * WebMessageInfo messageStubType. + * @member {proto.WebMessageInfo.WEB_MESSAGE_INFO_STUBTYPE} messageStubType + * @memberof proto.WebMessageInfo + * @instance + */ + WebMessageInfo.prototype.messageStubType = 0; + + /** + * WebMessageInfo clearMedia. + * @member {boolean} clearMedia + * @memberof proto.WebMessageInfo + * @instance + */ + WebMessageInfo.prototype.clearMedia = false; + + /** + * WebMessageInfo messageStubParameters. + * @member {Array.} messageStubParameters + * @memberof proto.WebMessageInfo + * @instance + */ + WebMessageInfo.prototype.messageStubParameters = $util.emptyArray; + + /** + * WebMessageInfo duration. + * @member {number} duration + * @memberof proto.WebMessageInfo + * @instance + */ + WebMessageInfo.prototype.duration = 0; + + /** + * WebMessageInfo labels. + * @member {Array.} labels + * @memberof proto.WebMessageInfo + * @instance + */ + WebMessageInfo.prototype.labels = $util.emptyArray; + + /** + * WebMessageInfo paymentInfo. + * @member {proto.IPaymentInfo|null|undefined} paymentInfo + * @memberof proto.WebMessageInfo + * @instance + */ + WebMessageInfo.prototype.paymentInfo = null; + + /** + * WebMessageInfo finalLiveLocation. + * @member {proto.ILiveLocationMessage|null|undefined} finalLiveLocation + * @memberof proto.WebMessageInfo + * @instance + */ + WebMessageInfo.prototype.finalLiveLocation = null; + + /** + * WebMessageInfo quotedPaymentInfo. + * @member {proto.IPaymentInfo|null|undefined} quotedPaymentInfo + * @memberof proto.WebMessageInfo + * @instance + */ + WebMessageInfo.prototype.quotedPaymentInfo = null; + + /** + * WebMessageInfo ephemeralStartTimestamp. + * @member {number|Long} ephemeralStartTimestamp + * @memberof proto.WebMessageInfo + * @instance + */ + WebMessageInfo.prototype.ephemeralStartTimestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * WebMessageInfo ephemeralDuration. + * @member {number} ephemeralDuration + * @memberof proto.WebMessageInfo + * @instance + */ + WebMessageInfo.prototype.ephemeralDuration = 0; + + /** + * Creates a new WebMessageInfo instance using the specified properties. + * @function create + * @memberof proto.WebMessageInfo + * @static + * @param {proto.IWebMessageInfo=} [properties] Properties to set + * @returns {proto.WebMessageInfo} WebMessageInfo instance + */ + WebMessageInfo.create = function create(properties) { + return new WebMessageInfo(properties); + }; + + /** + * Encodes the specified WebMessageInfo message. Does not implicitly {@link proto.WebMessageInfo.verify|verify} messages. + * @function encode + * @memberof proto.WebMessageInfo + * @static + * @param {proto.IWebMessageInfo} message WebMessageInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebMessageInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + $root.proto.MessageKey.encode(message.key, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + $root.proto.Message.encode(message.message, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.messageTimestamp != null && Object.hasOwnProperty.call(message, "messageTimestamp")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.messageTimestamp); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.status); + if (message.participant != null && Object.hasOwnProperty.call(message, "participant")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.participant); + if (message.ignore != null && Object.hasOwnProperty.call(message, "ignore")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ignore); + if (message.starred != null && Object.hasOwnProperty.call(message, "starred")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.starred); + if (message.broadcast != null && Object.hasOwnProperty.call(message, "broadcast")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.broadcast); + if (message.pushName != null && Object.hasOwnProperty.call(message, "pushName")) + writer.uint32(/* id 19, wireType 2 =*/154).string(message.pushName); + if (message.mediaCiphertextSha256 != null && Object.hasOwnProperty.call(message, "mediaCiphertextSha256")) + writer.uint32(/* id 20, wireType 2 =*/162).bytes(message.mediaCiphertextSha256); + if (message.multicast != null && Object.hasOwnProperty.call(message, "multicast")) + writer.uint32(/* id 21, wireType 0 =*/168).bool(message.multicast); + if (message.urlText != null && Object.hasOwnProperty.call(message, "urlText")) + writer.uint32(/* id 22, wireType 0 =*/176).bool(message.urlText); + if (message.urlNumber != null && Object.hasOwnProperty.call(message, "urlNumber")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.urlNumber); + if (message.messageStubType != null && Object.hasOwnProperty.call(message, "messageStubType")) + writer.uint32(/* id 24, wireType 0 =*/192).int32(message.messageStubType); + if (message.clearMedia != null && Object.hasOwnProperty.call(message, "clearMedia")) + writer.uint32(/* id 25, wireType 0 =*/200).bool(message.clearMedia); + if (message.messageStubParameters != null && message.messageStubParameters.length) + for (var i = 0; i < message.messageStubParameters.length; ++i) + writer.uint32(/* id 26, wireType 2 =*/210).string(message.messageStubParameters[i]); + if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) + writer.uint32(/* id 27, wireType 0 =*/216).uint32(message.duration); + if (message.labels != null && message.labels.length) + for (var i = 0; i < message.labels.length; ++i) + writer.uint32(/* id 28, wireType 2 =*/226).string(message.labels[i]); + if (message.paymentInfo != null && Object.hasOwnProperty.call(message, "paymentInfo")) + $root.proto.PaymentInfo.encode(message.paymentInfo, writer.uint32(/* id 29, wireType 2 =*/234).fork()).ldelim(); + if (message.finalLiveLocation != null && Object.hasOwnProperty.call(message, "finalLiveLocation")) + $root.proto.LiveLocationMessage.encode(message.finalLiveLocation, writer.uint32(/* id 30, wireType 2 =*/242).fork()).ldelim(); + if (message.quotedPaymentInfo != null && Object.hasOwnProperty.call(message, "quotedPaymentInfo")) + $root.proto.PaymentInfo.encode(message.quotedPaymentInfo, writer.uint32(/* id 31, wireType 2 =*/250).fork()).ldelim(); + if (message.ephemeralStartTimestamp != null && Object.hasOwnProperty.call(message, "ephemeralStartTimestamp")) + writer.uint32(/* id 32, wireType 0 =*/256).uint64(message.ephemeralStartTimestamp); + if (message.ephemeralDuration != null && Object.hasOwnProperty.call(message, "ephemeralDuration")) + writer.uint32(/* id 33, wireType 0 =*/264).uint32(message.ephemeralDuration); + return writer; + }; + + /** + * Encodes the specified WebMessageInfo message, length delimited. Does not implicitly {@link proto.WebMessageInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.WebMessageInfo + * @static + * @param {proto.IWebMessageInfo} message WebMessageInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebMessageInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WebMessageInfo message from the specified reader or buffer. + * @function decode + * @memberof proto.WebMessageInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.WebMessageInfo} WebMessageInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebMessageInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.WebMessageInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = $root.proto.MessageKey.decode(reader, reader.uint32()); + break; + case 2: + message.message = $root.proto.Message.decode(reader, reader.uint32()); + break; + case 3: + message.messageTimestamp = reader.uint64(); + break; + case 4: + message.status = reader.int32(); + break; + case 5: + message.participant = reader.string(); + break; + case 16: + message.ignore = reader.bool(); + break; + case 17: + message.starred = reader.bool(); + break; + case 18: + message.broadcast = reader.bool(); + break; + case 19: + message.pushName = reader.string(); + break; + case 20: + message.mediaCiphertextSha256 = reader.bytes(); + break; + case 21: + message.multicast = reader.bool(); + break; + case 22: + message.urlText = reader.bool(); + break; + case 23: + message.urlNumber = reader.bool(); + break; + case 24: + message.messageStubType = reader.int32(); + break; + case 25: + message.clearMedia = reader.bool(); + break; + case 26: + if (!(message.messageStubParameters && message.messageStubParameters.length)) + message.messageStubParameters = []; + message.messageStubParameters.push(reader.string()); + break; + case 27: + message.duration = reader.uint32(); + break; + case 28: + if (!(message.labels && message.labels.length)) + message.labels = []; + message.labels.push(reader.string()); + break; + case 29: + message.paymentInfo = $root.proto.PaymentInfo.decode(reader, reader.uint32()); + break; + case 30: + message.finalLiveLocation = $root.proto.LiveLocationMessage.decode(reader, reader.uint32()); + break; + case 31: + message.quotedPaymentInfo = $root.proto.PaymentInfo.decode(reader, reader.uint32()); + break; + case 32: + message.ephemeralStartTimestamp = reader.uint64(); + break; + case 33: + message.ephemeralDuration = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + if (!message.hasOwnProperty("key")) + throw $util.ProtocolError("missing required 'key'", { instance: message }); + return message; + }; + + /** + * Decodes a WebMessageInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.WebMessageInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.WebMessageInfo} WebMessageInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebMessageInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WebMessageInfo message. + * @function verify + * @memberof proto.WebMessageInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WebMessageInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + { + var error = $root.proto.MessageKey.verify(message.key); + if (error) + return "key." + error; + } + if (message.message != null && message.hasOwnProperty("message")) { + var error = $root.proto.Message.verify(message.message); + if (error) + return "message." + error; + } + if (message.messageTimestamp != null && message.hasOwnProperty("messageTimestamp")) + if (!$util.isInteger(message.messageTimestamp) && !(message.messageTimestamp && $util.isInteger(message.messageTimestamp.low) && $util.isInteger(message.messageTimestamp.high))) + return "messageTimestamp: integer|Long expected"; + if (message.status != null && message.hasOwnProperty("status")) + switch (message.status) { + default: + return "status: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.participant != null && message.hasOwnProperty("participant")) + if (!$util.isString(message.participant)) + return "participant: string expected"; + if (message.ignore != null && message.hasOwnProperty("ignore")) + if (typeof message.ignore !== "boolean") + return "ignore: boolean expected"; + if (message.starred != null && message.hasOwnProperty("starred")) + if (typeof message.starred !== "boolean") + return "starred: boolean expected"; + if (message.broadcast != null && message.hasOwnProperty("broadcast")) + if (typeof message.broadcast !== "boolean") + return "broadcast: boolean expected"; + if (message.pushName != null && message.hasOwnProperty("pushName")) + if (!$util.isString(message.pushName)) + return "pushName: string expected"; + if (message.mediaCiphertextSha256 != null && message.hasOwnProperty("mediaCiphertextSha256")) + if (!(message.mediaCiphertextSha256 && typeof message.mediaCiphertextSha256.length === "number" || $util.isString(message.mediaCiphertextSha256))) + return "mediaCiphertextSha256: buffer expected"; + if (message.multicast != null && message.hasOwnProperty("multicast")) + if (typeof message.multicast !== "boolean") + return "multicast: boolean expected"; + if (message.urlText != null && message.hasOwnProperty("urlText")) + if (typeof message.urlText !== "boolean") + return "urlText: boolean expected"; + if (message.urlNumber != null && message.hasOwnProperty("urlNumber")) + if (typeof message.urlNumber !== "boolean") + return "urlNumber: boolean expected"; + if (message.messageStubType != null && message.hasOwnProperty("messageStubType")) + switch (message.messageStubType) { + default: + return "messageStubType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + case 19: + case 20: + case 21: + case 22: + case 23: + case 24: + case 25: + case 26: + case 27: + case 28: + case 29: + case 30: + case 31: + case 32: + case 33: + case 34: + case 35: + case 36: + case 37: + case 38: + case 39: + case 40: + case 41: + case 42: + case 43: + case 44: + case 45: + case 46: + case 47: + case 48: + case 49: + case 50: + case 51: + case 52: + case 53: + case 54: + case 55: + case 56: + case 57: + case 58: + case 59: + case 60: + case 61: + case 62: + case 63: + case 64: + case 65: + case 66: + case 67: + case 68: + case 69: + case 70: + case 71: + case 72: + break; + } + if (message.clearMedia != null && message.hasOwnProperty("clearMedia")) + if (typeof message.clearMedia !== "boolean") + return "clearMedia: boolean expected"; + if (message.messageStubParameters != null && message.hasOwnProperty("messageStubParameters")) { + if (!Array.isArray(message.messageStubParameters)) + return "messageStubParameters: array expected"; + for (var i = 0; i < message.messageStubParameters.length; ++i) + if (!$util.isString(message.messageStubParameters[i])) + return "messageStubParameters: string[] expected"; + } + if (message.duration != null && message.hasOwnProperty("duration")) + if (!$util.isInteger(message.duration)) + return "duration: integer expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!Array.isArray(message.labels)) + return "labels: array expected"; + for (var i = 0; i < message.labels.length; ++i) + if (!$util.isString(message.labels[i])) + return "labels: string[] expected"; + } + if (message.paymentInfo != null && message.hasOwnProperty("paymentInfo")) { + var error = $root.proto.PaymentInfo.verify(message.paymentInfo); + if (error) + return "paymentInfo." + error; + } + if (message.finalLiveLocation != null && message.hasOwnProperty("finalLiveLocation")) { + var error = $root.proto.LiveLocationMessage.verify(message.finalLiveLocation); + if (error) + return "finalLiveLocation." + error; + } + if (message.quotedPaymentInfo != null && message.hasOwnProperty("quotedPaymentInfo")) { + var error = $root.proto.PaymentInfo.verify(message.quotedPaymentInfo); + if (error) + return "quotedPaymentInfo." + error; + } + if (message.ephemeralStartTimestamp != null && message.hasOwnProperty("ephemeralStartTimestamp")) + if (!$util.isInteger(message.ephemeralStartTimestamp) && !(message.ephemeralStartTimestamp && $util.isInteger(message.ephemeralStartTimestamp.low) && $util.isInteger(message.ephemeralStartTimestamp.high))) + return "ephemeralStartTimestamp: integer|Long expected"; + if (message.ephemeralDuration != null && message.hasOwnProperty("ephemeralDuration")) + if (!$util.isInteger(message.ephemeralDuration)) + return "ephemeralDuration: integer expected"; + return null; + }; + + /** + * Creates a WebMessageInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.WebMessageInfo + * @static + * @param {Object.} object Plain object + * @returns {proto.WebMessageInfo} WebMessageInfo + */ + WebMessageInfo.fromObject = function fromObject(object) { + if (object instanceof $root.proto.WebMessageInfo) + return object; + var message = new $root.proto.WebMessageInfo(); + if (object.key != null) { + if (typeof object.key !== "object") + throw TypeError(".proto.WebMessageInfo.key: object expected"); + message.key = $root.proto.MessageKey.fromObject(object.key); + } + if (object.message != null) { + if (typeof object.message !== "object") + throw TypeError(".proto.WebMessageInfo.message: object expected"); + message.message = $root.proto.Message.fromObject(object.message); + } + if (object.messageTimestamp != null) + if ($util.Long) + (message.messageTimestamp = $util.Long.fromValue(object.messageTimestamp)).unsigned = true; + else if (typeof object.messageTimestamp === "string") + message.messageTimestamp = parseInt(object.messageTimestamp, 10); + else if (typeof object.messageTimestamp === "number") + message.messageTimestamp = object.messageTimestamp; + else if (typeof object.messageTimestamp === "object") + message.messageTimestamp = new $util.LongBits(object.messageTimestamp.low >>> 0, object.messageTimestamp.high >>> 0).toNumber(true); + switch (object.status) { + case "ERROR": + case 0: + message.status = 0; + break; + case "PENDING": + case 1: + message.status = 1; + break; + case "SERVER_ACK": + case 2: + message.status = 2; + break; + case "DELIVERY_ACK": + case 3: + message.status = 3; + break; + case "READ": + case 4: + message.status = 4; + break; + case "PLAYED": + case 5: + message.status = 5; + break; + } + if (object.participant != null) + message.participant = String(object.participant); + if (object.ignore != null) + message.ignore = Boolean(object.ignore); + if (object.starred != null) + message.starred = Boolean(object.starred); + if (object.broadcast != null) + message.broadcast = Boolean(object.broadcast); + if (object.pushName != null) + message.pushName = String(object.pushName); + if (object.mediaCiphertextSha256 != null) + if (typeof object.mediaCiphertextSha256 === "string") + $util.base64.decode(object.mediaCiphertextSha256, message.mediaCiphertextSha256 = $util.newBuffer($util.base64.length(object.mediaCiphertextSha256)), 0); + else if (object.mediaCiphertextSha256.length) + message.mediaCiphertextSha256 = object.mediaCiphertextSha256; + if (object.multicast != null) + message.multicast = Boolean(object.multicast); + if (object.urlText != null) + message.urlText = Boolean(object.urlText); + if (object.urlNumber != null) + message.urlNumber = Boolean(object.urlNumber); + switch (object.messageStubType) { + case "UNKNOWN": + case 0: + message.messageStubType = 0; + break; + case "REVOKE": + case 1: + message.messageStubType = 1; + break; + case "CIPHERTEXT": + case 2: + message.messageStubType = 2; + break; + case "FUTUREPROOF": + case 3: + message.messageStubType = 3; + break; + case "NON_VERIFIED_TRANSITION": + case 4: + message.messageStubType = 4; + break; + case "UNVERIFIED_TRANSITION": + case 5: + message.messageStubType = 5; + break; + case "VERIFIED_TRANSITION": + case 6: + message.messageStubType = 6; + break; + case "VERIFIED_LOW_UNKNOWN": + case 7: + message.messageStubType = 7; + break; + case "VERIFIED_HIGH": + case 8: + message.messageStubType = 8; + break; + case "VERIFIED_INITIAL_UNKNOWN": + case 9: + message.messageStubType = 9; + break; + case "VERIFIED_INITIAL_LOW": + case 10: + message.messageStubType = 10; + break; + case "VERIFIED_INITIAL_HIGH": + case 11: + message.messageStubType = 11; + break; + case "VERIFIED_TRANSITION_ANY_TO_NONE": + case 12: + message.messageStubType = 12; + break; + case "VERIFIED_TRANSITION_ANY_TO_HIGH": + case 13: + message.messageStubType = 13; + break; + case "VERIFIED_TRANSITION_HIGH_TO_LOW": + case 14: + message.messageStubType = 14; + break; + case "VERIFIED_TRANSITION_HIGH_TO_UNKNOWN": + case 15: + message.messageStubType = 15; + break; + case "VERIFIED_TRANSITION_UNKNOWN_TO_LOW": + case 16: + message.messageStubType = 16; + break; + case "VERIFIED_TRANSITION_LOW_TO_UNKNOWN": + case 17: + message.messageStubType = 17; + break; + case "VERIFIED_TRANSITION_NONE_TO_LOW": + case 18: + message.messageStubType = 18; + break; + case "VERIFIED_TRANSITION_NONE_TO_UNKNOWN": + case 19: + message.messageStubType = 19; + break; + case "GROUP_CREATE": + case 20: + message.messageStubType = 20; + break; + case "GROUP_CHANGE_SUBJECT": + case 21: + message.messageStubType = 21; + break; + case "GROUP_CHANGE_ICON": + case 22: + message.messageStubType = 22; + break; + case "GROUP_CHANGE_INVITE_LINK": + case 23: + message.messageStubType = 23; + break; + case "GROUP_CHANGE_DESCRIPTION": + case 24: + message.messageStubType = 24; + break; + case "GROUP_CHANGE_RESTRICT": + case 25: + message.messageStubType = 25; + break; + case "GROUP_CHANGE_ANNOUNCE": + case 26: + message.messageStubType = 26; + break; + case "GROUP_PARTICIPANT_ADD": + case 27: + message.messageStubType = 27; + break; + case "GROUP_PARTICIPANT_REMOVE": + case 28: + message.messageStubType = 28; + break; + case "GROUP_PARTICIPANT_PROMOTE": + case 29: + message.messageStubType = 29; + break; + case "GROUP_PARTICIPANT_DEMOTE": + case 30: + message.messageStubType = 30; + break; + case "GROUP_PARTICIPANT_INVITE": + case 31: + message.messageStubType = 31; + break; + case "GROUP_PARTICIPANT_LEAVE": + case 32: + message.messageStubType = 32; + break; + case "GROUP_PARTICIPANT_CHANGE_NUMBER": + case 33: + message.messageStubType = 33; + break; + case "BROADCAST_CREATE": + case 34: + message.messageStubType = 34; + break; + case "BROADCAST_ADD": + case 35: + message.messageStubType = 35; + break; + case "BROADCAST_REMOVE": + case 36: + message.messageStubType = 36; + break; + case "GENERIC_NOTIFICATION": + case 37: + message.messageStubType = 37; + break; + case "E2E_IDENTITY_CHANGED": + case 38: + message.messageStubType = 38; + break; + case "E2E_ENCRYPTED": + case 39: + message.messageStubType = 39; + break; + case "CALL_MISSED_VOICE": + case 40: + message.messageStubType = 40; + break; + case "CALL_MISSED_VIDEO": + case 41: + message.messageStubType = 41; + break; + case "INDIVIDUAL_CHANGE_NUMBER": + case 42: + message.messageStubType = 42; + break; + case "GROUP_DELETE": + case 43: + message.messageStubType = 43; + break; + case "GROUP_ANNOUNCE_MODE_MESSAGE_BOUNCE": + case 44: + message.messageStubType = 44; + break; + case "CALL_MISSED_GROUP_VOICE": + case 45: + message.messageStubType = 45; + break; + case "CALL_MISSED_GROUP_VIDEO": + case 46: + message.messageStubType = 46; + break; + case "PAYMENT_CIPHERTEXT": + case 47: + message.messageStubType = 47; + break; + case "PAYMENT_FUTUREPROOF": + case 48: + message.messageStubType = 48; + break; + case "PAYMENT_TRANSACTION_STATUS_UPDATE_FAILED": + case 49: + message.messageStubType = 49; + break; + case "PAYMENT_TRANSACTION_STATUS_UPDATE_REFUNDED": + case 50: + message.messageStubType = 50; + break; + case "PAYMENT_TRANSACTION_STATUS_UPDATE_REFUND_FAILED": + case 51: + message.messageStubType = 51; + break; + case "PAYMENT_TRANSACTION_STATUS_RECEIVER_PENDING_SETUP": + case 52: + message.messageStubType = 52; + break; + case "PAYMENT_TRANSACTION_STATUS_RECEIVER_SUCCESS_AFTER_HICCUP": + case 53: + message.messageStubType = 53; + break; + case "PAYMENT_ACTION_ACCOUNT_SETUP_REMINDER": + case 54: + message.messageStubType = 54; + break; + case "PAYMENT_ACTION_SEND_PAYMENT_REMINDER": + case 55: + message.messageStubType = 55; + break; + case "PAYMENT_ACTION_SEND_PAYMENT_INVITATION": + case 56: + message.messageStubType = 56; + break; + case "PAYMENT_ACTION_REQUEST_DECLINED": + case 57: + message.messageStubType = 57; + break; + case "PAYMENT_ACTION_REQUEST_EXPIRED": + case 58: + message.messageStubType = 58; + break; + case "PAYMENT_ACTION_REQUEST_CANCELLED": + case 59: + message.messageStubType = 59; + break; + case "BIZ_VERIFIED_TRANSITION_TOP_TO_BOTTOM": + case 60: + message.messageStubType = 60; + break; + case "BIZ_VERIFIED_TRANSITION_BOTTOM_TO_TOP": + case 61: + message.messageStubType = 61; + break; + case "BIZ_INTRO_TOP": + case 62: + message.messageStubType = 62; + break; + case "BIZ_INTRO_BOTTOM": + case 63: + message.messageStubType = 63; + break; + case "BIZ_NAME_CHANGE": + case 64: + message.messageStubType = 64; + break; + case "BIZ_MOVE_TO_CONSUMER_APP": + case 65: + message.messageStubType = 65; + break; + case "BIZ_TWO_TIER_MIGRATION_TOP": + case 66: + message.messageStubType = 66; + break; + case "BIZ_TWO_TIER_MIGRATION_BOTTOM": + case 67: + message.messageStubType = 67; + break; + case "OVERSIZED": + case 68: + message.messageStubType = 68; + break; + case "GROUP_CHANGE_NO_FREQUENTLY_FORWARDED": + case 69: + message.messageStubType = 69; + break; + case "GROUP_V4_ADD_INVITE_SENT": + case 70: + message.messageStubType = 70; + break; + case "GROUP_PARTICIPANT_ADD_REQUEST_JOIN": + case 71: + message.messageStubType = 71; + break; + case "CHANGE_EPHEMERAL_SETTING": + case 72: + message.messageStubType = 72; + break; + } + if (object.clearMedia != null) + message.clearMedia = Boolean(object.clearMedia); + if (object.messageStubParameters) { + if (!Array.isArray(object.messageStubParameters)) + throw TypeError(".proto.WebMessageInfo.messageStubParameters: array expected"); + message.messageStubParameters = []; + for (var i = 0; i < object.messageStubParameters.length; ++i) + message.messageStubParameters[i] = String(object.messageStubParameters[i]); + } + if (object.duration != null) + message.duration = object.duration >>> 0; + if (object.labels) { + if (!Array.isArray(object.labels)) + throw TypeError(".proto.WebMessageInfo.labels: array expected"); + message.labels = []; + for (var i = 0; i < object.labels.length; ++i) + message.labels[i] = String(object.labels[i]); + } + if (object.paymentInfo != null) { + if (typeof object.paymentInfo !== "object") + throw TypeError(".proto.WebMessageInfo.paymentInfo: object expected"); + message.paymentInfo = $root.proto.PaymentInfo.fromObject(object.paymentInfo); + } + if (object.finalLiveLocation != null) { + if (typeof object.finalLiveLocation !== "object") + throw TypeError(".proto.WebMessageInfo.finalLiveLocation: object expected"); + message.finalLiveLocation = $root.proto.LiveLocationMessage.fromObject(object.finalLiveLocation); + } + if (object.quotedPaymentInfo != null) { + if (typeof object.quotedPaymentInfo !== "object") + throw TypeError(".proto.WebMessageInfo.quotedPaymentInfo: object expected"); + message.quotedPaymentInfo = $root.proto.PaymentInfo.fromObject(object.quotedPaymentInfo); + } + if (object.ephemeralStartTimestamp != null) + if ($util.Long) + (message.ephemeralStartTimestamp = $util.Long.fromValue(object.ephemeralStartTimestamp)).unsigned = true; + else if (typeof object.ephemeralStartTimestamp === "string") + message.ephemeralStartTimestamp = parseInt(object.ephemeralStartTimestamp, 10); + else if (typeof object.ephemeralStartTimestamp === "number") + message.ephemeralStartTimestamp = object.ephemeralStartTimestamp; + else if (typeof object.ephemeralStartTimestamp === "object") + message.ephemeralStartTimestamp = new $util.LongBits(object.ephemeralStartTimestamp.low >>> 0, object.ephemeralStartTimestamp.high >>> 0).toNumber(true); + if (object.ephemeralDuration != null) + message.ephemeralDuration = object.ephemeralDuration >>> 0; + return message; + }; + + /** + * Creates a plain object from a WebMessageInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.WebMessageInfo + * @static + * @param {proto.WebMessageInfo} message WebMessageInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WebMessageInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.messageStubParameters = []; + object.labels = []; + } + if (options.defaults) { + object.key = null; + object.message = null; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.messageTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.messageTimestamp = options.longs === String ? "0" : 0; + object.status = options.enums === String ? "ERROR" : 0; + object.participant = ""; + object.ignore = false; + object.starred = false; + object.broadcast = false; + object.pushName = ""; + if (options.bytes === String) + object.mediaCiphertextSha256 = ""; + else { + object.mediaCiphertextSha256 = []; + if (options.bytes !== Array) + object.mediaCiphertextSha256 = $util.newBuffer(object.mediaCiphertextSha256); + } + object.multicast = false; + object.urlText = false; + object.urlNumber = false; + object.messageStubType = options.enums === String ? "UNKNOWN" : 0; + object.clearMedia = false; + object.duration = 0; + object.paymentInfo = null; + object.finalLiveLocation = null; + object.quotedPaymentInfo = null; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.ephemeralStartTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.ephemeralStartTimestamp = options.longs === String ? "0" : 0; + object.ephemeralDuration = 0; + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = $root.proto.MessageKey.toObject(message.key, options); + if (message.message != null && message.hasOwnProperty("message")) + object.message = $root.proto.Message.toObject(message.message, options); + if (message.messageTimestamp != null && message.hasOwnProperty("messageTimestamp")) + if (typeof message.messageTimestamp === "number") + object.messageTimestamp = options.longs === String ? String(message.messageTimestamp) : message.messageTimestamp; + else + object.messageTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.messageTimestamp) : options.longs === Number ? new $util.LongBits(message.messageTimestamp.low >>> 0, message.messageTimestamp.high >>> 0).toNumber(true) : message.messageTimestamp; + if (message.status != null && message.hasOwnProperty("status")) + object.status = options.enums === String ? $root.proto.WebMessageInfo.WEB_MESSAGE_INFO_STATUS[message.status] : message.status; + if (message.participant != null && message.hasOwnProperty("participant")) + object.participant = message.participant; + if (message.ignore != null && message.hasOwnProperty("ignore")) + object.ignore = message.ignore; + if (message.starred != null && message.hasOwnProperty("starred")) + object.starred = message.starred; + if (message.broadcast != null && message.hasOwnProperty("broadcast")) + object.broadcast = message.broadcast; + if (message.pushName != null && message.hasOwnProperty("pushName")) + object.pushName = message.pushName; + if (message.mediaCiphertextSha256 != null && message.hasOwnProperty("mediaCiphertextSha256")) + object.mediaCiphertextSha256 = options.bytes === String ? $util.base64.encode(message.mediaCiphertextSha256, 0, message.mediaCiphertextSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.mediaCiphertextSha256) : message.mediaCiphertextSha256; + if (message.multicast != null && message.hasOwnProperty("multicast")) + object.multicast = message.multicast; + if (message.urlText != null && message.hasOwnProperty("urlText")) + object.urlText = message.urlText; + if (message.urlNumber != null && message.hasOwnProperty("urlNumber")) + object.urlNumber = message.urlNumber; + if (message.messageStubType != null && message.hasOwnProperty("messageStubType")) + object.messageStubType = options.enums === String ? $root.proto.WebMessageInfo.WEB_MESSAGE_INFO_STUBTYPE[message.messageStubType] : message.messageStubType; + if (message.clearMedia != null && message.hasOwnProperty("clearMedia")) + object.clearMedia = message.clearMedia; + if (message.messageStubParameters && message.messageStubParameters.length) { + object.messageStubParameters = []; + for (var j = 0; j < message.messageStubParameters.length; ++j) + object.messageStubParameters[j] = message.messageStubParameters[j]; + } + if (message.duration != null && message.hasOwnProperty("duration")) + object.duration = message.duration; + if (message.labels && message.labels.length) { + object.labels = []; + for (var j = 0; j < message.labels.length; ++j) + object.labels[j] = message.labels[j]; + } + if (message.paymentInfo != null && message.hasOwnProperty("paymentInfo")) + object.paymentInfo = $root.proto.PaymentInfo.toObject(message.paymentInfo, options); + if (message.finalLiveLocation != null && message.hasOwnProperty("finalLiveLocation")) + object.finalLiveLocation = $root.proto.LiveLocationMessage.toObject(message.finalLiveLocation, options); + if (message.quotedPaymentInfo != null && message.hasOwnProperty("quotedPaymentInfo")) + object.quotedPaymentInfo = $root.proto.PaymentInfo.toObject(message.quotedPaymentInfo, options); + if (message.ephemeralStartTimestamp != null && message.hasOwnProperty("ephemeralStartTimestamp")) + if (typeof message.ephemeralStartTimestamp === "number") + object.ephemeralStartTimestamp = options.longs === String ? String(message.ephemeralStartTimestamp) : message.ephemeralStartTimestamp; + else + object.ephemeralStartTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.ephemeralStartTimestamp) : options.longs === Number ? new $util.LongBits(message.ephemeralStartTimestamp.low >>> 0, message.ephemeralStartTimestamp.high >>> 0).toNumber(true) : message.ephemeralStartTimestamp; + if (message.ephemeralDuration != null && message.hasOwnProperty("ephemeralDuration")) + object.ephemeralDuration = message.ephemeralDuration; + return object; + }; + + /** + * Converts this WebMessageInfo to JSON. + * @function toJSON + * @memberof proto.WebMessageInfo + * @instance + * @returns {Object.} JSON object + */ + WebMessageInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * WEB_MESSAGE_INFO_STATUS enum. + * @name proto.WebMessageInfo.WEB_MESSAGE_INFO_STATUS + * @enum {number} + * @property {number} ERROR=0 ERROR value + * @property {number} PENDING=1 PENDING value + * @property {number} SERVER_ACK=2 SERVER_ACK value + * @property {number} DELIVERY_ACK=3 DELIVERY_ACK value + * @property {number} READ=4 READ value + * @property {number} PLAYED=5 PLAYED value + */ + WebMessageInfo.WEB_MESSAGE_INFO_STATUS = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ERROR"] = 0; + values[valuesById[1] = "PENDING"] = 1; + values[valuesById[2] = "SERVER_ACK"] = 2; + values[valuesById[3] = "DELIVERY_ACK"] = 3; + values[valuesById[4] = "READ"] = 4; + values[valuesById[5] = "PLAYED"] = 5; + return values; + })(); + + /** + * WEB_MESSAGE_INFO_STUBTYPE enum. + * @name proto.WebMessageInfo.WEB_MESSAGE_INFO_STUBTYPE + * @enum {number} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} REVOKE=1 REVOKE value + * @property {number} CIPHERTEXT=2 CIPHERTEXT value + * @property {number} FUTUREPROOF=3 FUTUREPROOF value + * @property {number} NON_VERIFIED_TRANSITION=4 NON_VERIFIED_TRANSITION value + * @property {number} UNVERIFIED_TRANSITION=5 UNVERIFIED_TRANSITION value + * @property {number} VERIFIED_TRANSITION=6 VERIFIED_TRANSITION value + * @property {number} VERIFIED_LOW_UNKNOWN=7 VERIFIED_LOW_UNKNOWN value + * @property {number} VERIFIED_HIGH=8 VERIFIED_HIGH value + * @property {number} VERIFIED_INITIAL_UNKNOWN=9 VERIFIED_INITIAL_UNKNOWN value + * @property {number} VERIFIED_INITIAL_LOW=10 VERIFIED_INITIAL_LOW value + * @property {number} VERIFIED_INITIAL_HIGH=11 VERIFIED_INITIAL_HIGH value + * @property {number} VERIFIED_TRANSITION_ANY_TO_NONE=12 VERIFIED_TRANSITION_ANY_TO_NONE value + * @property {number} VERIFIED_TRANSITION_ANY_TO_HIGH=13 VERIFIED_TRANSITION_ANY_TO_HIGH value + * @property {number} VERIFIED_TRANSITION_HIGH_TO_LOW=14 VERIFIED_TRANSITION_HIGH_TO_LOW value + * @property {number} VERIFIED_TRANSITION_HIGH_TO_UNKNOWN=15 VERIFIED_TRANSITION_HIGH_TO_UNKNOWN value + * @property {number} VERIFIED_TRANSITION_UNKNOWN_TO_LOW=16 VERIFIED_TRANSITION_UNKNOWN_TO_LOW value + * @property {number} VERIFIED_TRANSITION_LOW_TO_UNKNOWN=17 VERIFIED_TRANSITION_LOW_TO_UNKNOWN value + * @property {number} VERIFIED_TRANSITION_NONE_TO_LOW=18 VERIFIED_TRANSITION_NONE_TO_LOW value + * @property {number} VERIFIED_TRANSITION_NONE_TO_UNKNOWN=19 VERIFIED_TRANSITION_NONE_TO_UNKNOWN value + * @property {number} GROUP_CREATE=20 GROUP_CREATE value + * @property {number} GROUP_CHANGE_SUBJECT=21 GROUP_CHANGE_SUBJECT value + * @property {number} GROUP_CHANGE_ICON=22 GROUP_CHANGE_ICON value + * @property {number} GROUP_CHANGE_INVITE_LINK=23 GROUP_CHANGE_INVITE_LINK value + * @property {number} GROUP_CHANGE_DESCRIPTION=24 GROUP_CHANGE_DESCRIPTION value + * @property {number} GROUP_CHANGE_RESTRICT=25 GROUP_CHANGE_RESTRICT value + * @property {number} GROUP_CHANGE_ANNOUNCE=26 GROUP_CHANGE_ANNOUNCE value + * @property {number} GROUP_PARTICIPANT_ADD=27 GROUP_PARTICIPANT_ADD value + * @property {number} GROUP_PARTICIPANT_REMOVE=28 GROUP_PARTICIPANT_REMOVE value + * @property {number} GROUP_PARTICIPANT_PROMOTE=29 GROUP_PARTICIPANT_PROMOTE value + * @property {number} GROUP_PARTICIPANT_DEMOTE=30 GROUP_PARTICIPANT_DEMOTE value + * @property {number} GROUP_PARTICIPANT_INVITE=31 GROUP_PARTICIPANT_INVITE value + * @property {number} GROUP_PARTICIPANT_LEAVE=32 GROUP_PARTICIPANT_LEAVE value + * @property {number} GROUP_PARTICIPANT_CHANGE_NUMBER=33 GROUP_PARTICIPANT_CHANGE_NUMBER value + * @property {number} BROADCAST_CREATE=34 BROADCAST_CREATE value + * @property {number} BROADCAST_ADD=35 BROADCAST_ADD value + * @property {number} BROADCAST_REMOVE=36 BROADCAST_REMOVE value + * @property {number} GENERIC_NOTIFICATION=37 GENERIC_NOTIFICATION value + * @property {number} E2E_IDENTITY_CHANGED=38 E2E_IDENTITY_CHANGED value + * @property {number} E2E_ENCRYPTED=39 E2E_ENCRYPTED value + * @property {number} CALL_MISSED_VOICE=40 CALL_MISSED_VOICE value + * @property {number} CALL_MISSED_VIDEO=41 CALL_MISSED_VIDEO value + * @property {number} INDIVIDUAL_CHANGE_NUMBER=42 INDIVIDUAL_CHANGE_NUMBER value + * @property {number} GROUP_DELETE=43 GROUP_DELETE value + * @property {number} GROUP_ANNOUNCE_MODE_MESSAGE_BOUNCE=44 GROUP_ANNOUNCE_MODE_MESSAGE_BOUNCE value + * @property {number} CALL_MISSED_GROUP_VOICE=45 CALL_MISSED_GROUP_VOICE value + * @property {number} CALL_MISSED_GROUP_VIDEO=46 CALL_MISSED_GROUP_VIDEO value + * @property {number} PAYMENT_CIPHERTEXT=47 PAYMENT_CIPHERTEXT value + * @property {number} PAYMENT_FUTUREPROOF=48 PAYMENT_FUTUREPROOF value + * @property {number} PAYMENT_TRANSACTION_STATUS_UPDATE_FAILED=49 PAYMENT_TRANSACTION_STATUS_UPDATE_FAILED value + * @property {number} PAYMENT_TRANSACTION_STATUS_UPDATE_REFUNDED=50 PAYMENT_TRANSACTION_STATUS_UPDATE_REFUNDED value + * @property {number} PAYMENT_TRANSACTION_STATUS_UPDATE_REFUND_FAILED=51 PAYMENT_TRANSACTION_STATUS_UPDATE_REFUND_FAILED value + * @property {number} PAYMENT_TRANSACTION_STATUS_RECEIVER_PENDING_SETUP=52 PAYMENT_TRANSACTION_STATUS_RECEIVER_PENDING_SETUP value + * @property {number} PAYMENT_TRANSACTION_STATUS_RECEIVER_SUCCESS_AFTER_HICCUP=53 PAYMENT_TRANSACTION_STATUS_RECEIVER_SUCCESS_AFTER_HICCUP value + * @property {number} PAYMENT_ACTION_ACCOUNT_SETUP_REMINDER=54 PAYMENT_ACTION_ACCOUNT_SETUP_REMINDER value + * @property {number} PAYMENT_ACTION_SEND_PAYMENT_REMINDER=55 PAYMENT_ACTION_SEND_PAYMENT_REMINDER value + * @property {number} PAYMENT_ACTION_SEND_PAYMENT_INVITATION=56 PAYMENT_ACTION_SEND_PAYMENT_INVITATION value + * @property {number} PAYMENT_ACTION_REQUEST_DECLINED=57 PAYMENT_ACTION_REQUEST_DECLINED value + * @property {number} PAYMENT_ACTION_REQUEST_EXPIRED=58 PAYMENT_ACTION_REQUEST_EXPIRED value + * @property {number} PAYMENT_ACTION_REQUEST_CANCELLED=59 PAYMENT_ACTION_REQUEST_CANCELLED value + * @property {number} BIZ_VERIFIED_TRANSITION_TOP_TO_BOTTOM=60 BIZ_VERIFIED_TRANSITION_TOP_TO_BOTTOM value + * @property {number} BIZ_VERIFIED_TRANSITION_BOTTOM_TO_TOP=61 BIZ_VERIFIED_TRANSITION_BOTTOM_TO_TOP value + * @property {number} BIZ_INTRO_TOP=62 BIZ_INTRO_TOP value + * @property {number} BIZ_INTRO_BOTTOM=63 BIZ_INTRO_BOTTOM value + * @property {number} BIZ_NAME_CHANGE=64 BIZ_NAME_CHANGE value + * @property {number} BIZ_MOVE_TO_CONSUMER_APP=65 BIZ_MOVE_TO_CONSUMER_APP value + * @property {number} BIZ_TWO_TIER_MIGRATION_TOP=66 BIZ_TWO_TIER_MIGRATION_TOP value + * @property {number} BIZ_TWO_TIER_MIGRATION_BOTTOM=67 BIZ_TWO_TIER_MIGRATION_BOTTOM value + * @property {number} OVERSIZED=68 OVERSIZED value + * @property {number} GROUP_CHANGE_NO_FREQUENTLY_FORWARDED=69 GROUP_CHANGE_NO_FREQUENTLY_FORWARDED value + * @property {number} GROUP_V4_ADD_INVITE_SENT=70 GROUP_V4_ADD_INVITE_SENT value + * @property {number} GROUP_PARTICIPANT_ADD_REQUEST_JOIN=71 GROUP_PARTICIPANT_ADD_REQUEST_JOIN value + * @property {number} CHANGE_EPHEMERAL_SETTING=72 CHANGE_EPHEMERAL_SETTING value + */ + WebMessageInfo.WEB_MESSAGE_INFO_STUBTYPE = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "REVOKE"] = 1; + values[valuesById[2] = "CIPHERTEXT"] = 2; + values[valuesById[3] = "FUTUREPROOF"] = 3; + values[valuesById[4] = "NON_VERIFIED_TRANSITION"] = 4; + values[valuesById[5] = "UNVERIFIED_TRANSITION"] = 5; + values[valuesById[6] = "VERIFIED_TRANSITION"] = 6; + values[valuesById[7] = "VERIFIED_LOW_UNKNOWN"] = 7; + values[valuesById[8] = "VERIFIED_HIGH"] = 8; + values[valuesById[9] = "VERIFIED_INITIAL_UNKNOWN"] = 9; + values[valuesById[10] = "VERIFIED_INITIAL_LOW"] = 10; + values[valuesById[11] = "VERIFIED_INITIAL_HIGH"] = 11; + values[valuesById[12] = "VERIFIED_TRANSITION_ANY_TO_NONE"] = 12; + values[valuesById[13] = "VERIFIED_TRANSITION_ANY_TO_HIGH"] = 13; + values[valuesById[14] = "VERIFIED_TRANSITION_HIGH_TO_LOW"] = 14; + values[valuesById[15] = "VERIFIED_TRANSITION_HIGH_TO_UNKNOWN"] = 15; + values[valuesById[16] = "VERIFIED_TRANSITION_UNKNOWN_TO_LOW"] = 16; + values[valuesById[17] = "VERIFIED_TRANSITION_LOW_TO_UNKNOWN"] = 17; + values[valuesById[18] = "VERIFIED_TRANSITION_NONE_TO_LOW"] = 18; + values[valuesById[19] = "VERIFIED_TRANSITION_NONE_TO_UNKNOWN"] = 19; + values[valuesById[20] = "GROUP_CREATE"] = 20; + values[valuesById[21] = "GROUP_CHANGE_SUBJECT"] = 21; + values[valuesById[22] = "GROUP_CHANGE_ICON"] = 22; + values[valuesById[23] = "GROUP_CHANGE_INVITE_LINK"] = 23; + values[valuesById[24] = "GROUP_CHANGE_DESCRIPTION"] = 24; + values[valuesById[25] = "GROUP_CHANGE_RESTRICT"] = 25; + values[valuesById[26] = "GROUP_CHANGE_ANNOUNCE"] = 26; + values[valuesById[27] = "GROUP_PARTICIPANT_ADD"] = 27; + values[valuesById[28] = "GROUP_PARTICIPANT_REMOVE"] = 28; + values[valuesById[29] = "GROUP_PARTICIPANT_PROMOTE"] = 29; + values[valuesById[30] = "GROUP_PARTICIPANT_DEMOTE"] = 30; + values[valuesById[31] = "GROUP_PARTICIPANT_INVITE"] = 31; + values[valuesById[32] = "GROUP_PARTICIPANT_LEAVE"] = 32; + values[valuesById[33] = "GROUP_PARTICIPANT_CHANGE_NUMBER"] = 33; + values[valuesById[34] = "BROADCAST_CREATE"] = 34; + values[valuesById[35] = "BROADCAST_ADD"] = 35; + values[valuesById[36] = "BROADCAST_REMOVE"] = 36; + values[valuesById[37] = "GENERIC_NOTIFICATION"] = 37; + values[valuesById[38] = "E2E_IDENTITY_CHANGED"] = 38; + values[valuesById[39] = "E2E_ENCRYPTED"] = 39; + values[valuesById[40] = "CALL_MISSED_VOICE"] = 40; + values[valuesById[41] = "CALL_MISSED_VIDEO"] = 41; + values[valuesById[42] = "INDIVIDUAL_CHANGE_NUMBER"] = 42; + values[valuesById[43] = "GROUP_DELETE"] = 43; + values[valuesById[44] = "GROUP_ANNOUNCE_MODE_MESSAGE_BOUNCE"] = 44; + values[valuesById[45] = "CALL_MISSED_GROUP_VOICE"] = 45; + values[valuesById[46] = "CALL_MISSED_GROUP_VIDEO"] = 46; + values[valuesById[47] = "PAYMENT_CIPHERTEXT"] = 47; + values[valuesById[48] = "PAYMENT_FUTUREPROOF"] = 48; + values[valuesById[49] = "PAYMENT_TRANSACTION_STATUS_UPDATE_FAILED"] = 49; + values[valuesById[50] = "PAYMENT_TRANSACTION_STATUS_UPDATE_REFUNDED"] = 50; + values[valuesById[51] = "PAYMENT_TRANSACTION_STATUS_UPDATE_REFUND_FAILED"] = 51; + values[valuesById[52] = "PAYMENT_TRANSACTION_STATUS_RECEIVER_PENDING_SETUP"] = 52; + values[valuesById[53] = "PAYMENT_TRANSACTION_STATUS_RECEIVER_SUCCESS_AFTER_HICCUP"] = 53; + values[valuesById[54] = "PAYMENT_ACTION_ACCOUNT_SETUP_REMINDER"] = 54; + values[valuesById[55] = "PAYMENT_ACTION_SEND_PAYMENT_REMINDER"] = 55; + values[valuesById[56] = "PAYMENT_ACTION_SEND_PAYMENT_INVITATION"] = 56; + values[valuesById[57] = "PAYMENT_ACTION_REQUEST_DECLINED"] = 57; + values[valuesById[58] = "PAYMENT_ACTION_REQUEST_EXPIRED"] = 58; + values[valuesById[59] = "PAYMENT_ACTION_REQUEST_CANCELLED"] = 59; + values[valuesById[60] = "BIZ_VERIFIED_TRANSITION_TOP_TO_BOTTOM"] = 60; + values[valuesById[61] = "BIZ_VERIFIED_TRANSITION_BOTTOM_TO_TOP"] = 61; + values[valuesById[62] = "BIZ_INTRO_TOP"] = 62; + values[valuesById[63] = "BIZ_INTRO_BOTTOM"] = 63; + values[valuesById[64] = "BIZ_NAME_CHANGE"] = 64; + values[valuesById[65] = "BIZ_MOVE_TO_CONSUMER_APP"] = 65; + values[valuesById[66] = "BIZ_TWO_TIER_MIGRATION_TOP"] = 66; + values[valuesById[67] = "BIZ_TWO_TIER_MIGRATION_BOTTOM"] = 67; + values[valuesById[68] = "OVERSIZED"] = 68; + values[valuesById[69] = "GROUP_CHANGE_NO_FREQUENTLY_FORWARDED"] = 69; + values[valuesById[70] = "GROUP_V4_ADD_INVITE_SENT"] = 70; + values[valuesById[71] = "GROUP_PARTICIPANT_ADD_REQUEST_JOIN"] = 71; + values[valuesById[72] = "CHANGE_EPHEMERAL_SETTING"] = 72; + return values; + })(); + + return WebMessageInfo; + })(); + + return proto; +})(); + +module.exports = $root; diff --git a/binary_coding/def.proto b/Binary/def.proto similarity index 100% rename from binary_coding/def.proto rename to Binary/def.proto diff --git a/example/ConversationExtract.js b/Example/ConversationExtract.js similarity index 100% rename from example/ConversationExtract.js rename to Example/ConversationExtract.js diff --git a/Example/example.ts b/Example/example.ts new file mode 100644 index 0000000..93fe9db --- /dev/null +++ b/Example/example.ts @@ -0,0 +1,144 @@ +import { + WAClient, + AuthenticationCredentialsBase64, + getNotificationType, + MessageType, + decodeMediaMessage, + Presence, + MessageOptions, + Mimetype, +} from '../WAClient/WAClient' +import fs from 'fs' + +async function example() { + const client = new WAClient() // instantiate + client.autoReconnect = true // auto reconnect on disconnect + client.logUnhandledMessages = false // set to true to see what kind of stuff you can implement + + let authInfo: AuthenticationCredentialsBase64 = null + try { + const file = fs.readFileSync('auth_info.json') // load a closed session back if it exists + authInfo = JSON.parse(file) + } catch {} + + // connect or timeout in 20 seconds + const [user, chats, contacts, unread] = await client.connect(authInfo, 20 * 1000) + + console.log('oh hello ' + user.name + ' (' + user.id + ')') + console.log('you have ' + unread.length + ' unread messages') + console.log('you have ' + chats.length + ' chats & ' + contacts.length + ' contacts') + + authInfo = client.base64EncodedAuthInfo() // get all the auth info we need to restore this session + fs.writeFileSync('./auth_info.json', JSON.stringify(authInfo, null, '\t')) // save this info to a file + /* Note: one can take this auth_info.json file and login again from any computer without having to scan the QR code, + and get full access to one's WhatsApp. Despite the convenience, be careful with this file */ + + client.setOnPresenceUpdate((json) => console.log(json.id + ' presence is ' + json.type)) + client.setOnMessageStatusChange((json) => { + const participant = json.participant ? ' (' + json.participant + ')' : '' // participant exists when the message is from a group + console.log( + json.to + + participant + + ' acknowledged message(s) ' + + json.ids + + ' as ' + + json.type + + ' at ' + + json.timestamp, + ) + }) + client.setOnUnreadMessage(async (m) => { + const [notificationType, messageType] = getNotificationType(m) // get what type of notification it is -- message, group add notification etc. + console.log('got notification of type: ' + notificationType) + + if (notificationType !== 'message') { + return + } + if (m.key.fromMe) { + console.log('relayed my own message') + return + } + + let sender = m.key.remoteJid + if (m.key.participant) { + // participant exists if the message is in a group + sender += ' (' + m.key.participant + ')' + } + if (messageType === MessageType.text) { + const text = m.message.conversation + console.log(sender + ' sent: ' + text) + } else if (messageType === MessageType.extendedText) { + const text = m.message.extendedTextMessage.text + console.log(sender + ' sent: ' + text + ' and quoted message: ' + JSON.stringify(m.message)) + } else if (messageType === MessageType.contact) { + const contact = m.message.contactMessage + console.log(sender + ' sent contact (' + contact.displayName + '): ' + contact.vcard) + } else if (messageType === MessageType.location || messageType === MessageType.liveLocation) { + const locMessage = m.message[messageType] + console.log( + sender + + ' sent location (lat: ' + + locMessage.degreesLatitude + + ', long: ' + + locMessage.degreesLongitude + + '), saving thumbnail...', + ) + decodeMediaMessage(m.message, 'loc_thumb_in_' + m.key.id) + + if (messageType === MessageType.liveLocation) { + console.log( + sender + + ' sent live location for duration: ' + + m.duration / 60 + + ' minutes, seq number: ' + + locMessage.sequenceNumber, + ) + } + } else { + // if it is a media (audio, image, video) message + // decode, decrypt & save the media. + // The extension to the is applied automatically based on the media type + try { + const savedFile = await decodeMediaMessage(m.message, 'media_in_' + m.key.id) + console.log(sender + ' sent media, saved at: ' + savedFile) + } catch (err) { + console.log('error in decoding message: ' + err) + } + } + // send a reply after 3 seconds + setTimeout(async () => { + await client.sendReadReceipt(m.key.remoteJid, m.key.id) // send read receipt + await client.updatePresence(m.key.remoteJid, Presence.available) // tell them we're available + await client.updatePresence(m.key.remoteJid, Presence.composing) // tell them we're composing + + const options: MessageOptions = { quoted: m } + let content + let type: MessageType + const rand = Math.random() + if (rand > 0.66) { + // choose at random + content = 'hello!' // send a "hello!" & quote the message recieved + type = MessageType.text + } else if (rand > 0.33) { + // choose at random + content = { degreesLatitude: 32.123123, degreesLongitude: 12.12123123 } + type = MessageType.location + } else { + content = fs.readFileSync('example/ma_gif.mp4') // load the gif + options.mimetype = Mimetype.gif + } + const response = await client.sendMessage(m.key.remoteJid, content, type, options) + console.log("sent message with ID '" + response.messageID + "' successfully: " + (response.status === 200)) + }, 3 * 1000) + }, true) // set to false to not relay your own sent messages + + /* example of custom functionality for tracking battery */ + client.registerCallback(['action', null, 'battery'], (json) => { + const batteryLevelStr = json[2][0][1].value + const batterylevel = parseInt(batteryLevelStr) + console.log('battery level: ' + batterylevel) + }) + client.setOnUnexpectedDisconnect((err) => console.log('disconnected unexpectedly: ' + err)) +} + +example().catch((err) => console.log(`encountered error: ${err}`)) diff --git a/example/ma_gif.mp4 b/Media/ma_gif.mp4 similarity index 100% rename from example/ma_gif.mp4 rename to Media/ma_gif.mp4 diff --git a/example/meme.jpeg b/Media/meme.jpeg similarity index 100% rename from example/meme.jpeg rename to Media/meme.jpeg diff --git a/Media/received_img.jpeg b/Media/received_img.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..e09535bcd05a6ae420a1099707931c4ba6566c9a GIT binary patch literal 57782 zcmb5VbzD>58wY+#0XL-?1Ej_rAq*HPAdHZ1kgm}sDT1PafH1ndMu#XJq9P5Wy9AXO zp)?{`zkR;Hdj0 zoVR7ZElvH#!YUk^Y>MLI+Qkdg2Jq;w=?bR_@! z04P8_Cl=uUEhMC5>(&|DP)0zq)_R0EmnPAf+Xv1pv}xl^qg55kO@HI}A;S zDQ2sG1h~in6t{uu3s*Z7zy&mbB)@I%c6eLkN%M5rwC&OXUrnBxnzQr-=Y-lk>2K2P z@8dT2WrE)pZxz;+4+P8-HqW2Vq`PVppZ>3iBHiM(0XD^Mz#$J5mx5xPK>%)fv7OY5C#Adni`C0cLFpqb4BGYZ2J~nNme6WZxUCIcYgSv>`WACH@Ou9 z06759dccfx*C#<5lX4dWnyIkKYH`iX8CrnUE>DQxGjCtZ+@RI1Pc!X)ZbIPJ>=}8B z*^4aMah+ek{{g01QZ}ZSSNC-v!moA9niA#nzg^}D*Nt=d^Pm!H>u$B&`8b3~d$ulBcQ_&CX@&{dB0QSY zJfOkRxmz))+7GYiDF}SqnAe2TWN4P9QUR3N@aRb-C0vw@0TK}jVio8GlOstg+$ut} z8yN0T85wyS83kAwt_(>88z_bWI#eVN6X)K<0puv|MoqMFWc7W8CmTY=BuJvRr{9S+ z_AM)Fl0qUKhz`N0!Ei@S0s!o2a_MZ^QubC4zIfc-#_57DF*0Ytm&v~#%d-VGw)jqX z&cs<|-VcHw&mr<0#5?)$K?QeW$R`0X36rGD*41j3oQ}zeb_1NYMg;{XV<37N00Cww zvjI`j4vaQeH7#YQOBr5?R}t&(H6q}hR^xsvLS>Ito=$?>4FG<8+@1BG_B?h@;+j(h zBQ=xL3<}wtSdscf)sj!zgxn!P0XW(|UIt>HsB6LE)25^eNOBYxX;JNV2n&Z_f@9`r z<{0u-PG%ic6;~oAVZacqCCsUisZn5*+!@_z>e)d8P?M>HTH=xllmLhULOgZl;(jz!WR7A|k87fsE43=H=&1H=mA@xmG5++) z<$0m*L#>Il+le^#4BrxO9hCU>;Akve>5znZY>AMfdee-I@0_x=MevWTEK@c9Vn8Ax zQ!Rr870ydebQJOt%Z+I_{M7g>90coaY^YkNBm4H}AFvBwV+THM`fFMS4w3G$z8w-U z$Gq8+BTaAcAOqhXf94=w(>`5)qP9;S0HGYv_wM+-Z{;Q1G!lhh8m=p;C7hxg zQzMm?86eqx-6Ub)|0!RC43fRI@cKo=qxNd|3{9ZM8+5WPgxZQL`2DA&-r-9wo@Slq zRiSRPVZtr6yK{o6!!lN73ZN>l_J-!ZxNqj#Ti}t)WnUixrY>ecJ4UzyiXXiI4jQEdzjNc+JsPJe z$7;L^4t$v9x-)2_Kc?|Mf5G{DqT#*8p6}KI-m#)yks`B$iUdworru4f9}x*I_M)I4 z;BrlN?;8N~h35Z_obng9fXsT9WYB0P^WKPWN%XvOCKQGg_iCTjxQ9o{Vl^4a(bJ~9 z+M8&)N@N(qL^9gYPI^-2_R|!Pg87b4D@`MHDh6^<+DSM?zxl3Dpr23zK$AhotEBaQ zWUbPi(kw&FnvNp!^xS{APlAgaF5{uO)K!zdJYkMZXlmkLN_J-rxU;ph@%_bUVT|}} zjYV$QtV@;}Qy8?Hgmsn+l$i}CwHHVZXVgL{p@}x72*N1)br2Ndp%dzQAmx4 zV<2_!tkP;3T8R?6qW7zh6@7&$C^eaSD=of1)c=hp6{=+QiM`dC@=cnWMzIOivK>ex z!Z=C_77tKvrEetw-IQFKS$g-A8r?s~>aYr_I&(L+^u$GY4!(T$B-wk*Xm)(21_0>o z-~h>cC<|liqaxjLolX-c3yGs{!W$wCD(0H1mg%OrLyZ9-HnDHXq4=(?luB3A;%PlY zSJs5}C3~%_I&^kn>hup-i*#T{tzQE`srUsPJEK8raM|d0x&CLmIn5P2y47QRD8U!J zI>A%ReodbKU=I$;{1=%ISb``<$jsqoW60n`YBGQXL_3+mEufMfNmVK2MMTJm`}G#W zEB+nzuSAzEV-56bjm9#EUp0!4XZRAPqVSkEGqU#$cVi#`fC9KzFW4)+p>Z>(@5Cxi z^mlIo!q%)j210f_rW-VhE@fuXLN!7<%#tX!Kp~pl?Y)7Til!P?fdW3?iQsyxUreKq z)bhFqm32SL0Hhv>MBzfKZjd6CoympIkFn|%DfPPVZY6j4^^NV5Y@CHh3bYheT(t~K zD)Kqlm%~_KHV*!n@h?QG0RUluHlHD%z80M>t4dgyfW`OM3aN*c@>=yjug?{VGc80% z`FDMcxPRLln%z7}T8&r2S8VkvQjw5Uwte|!@#r*A)!!4(Pa&Fedb}j}#J4{F+o)e+ zsj{U+R-$b1H~4%LO-AY>NXQFCGCLmmy7G>1XWiMrt4e-U4SX}5U_N6Nv}SUft$Opk;)1YF6i*c4g~PrnA|wh2QWaK5s);h8DQMo?2z%VhDoI&}*?ojnVk z1WLO7f88Lpi;hI5MAoWEh9i|piUWmhYJ0NG^D2%B#uyeZ z+{Q9d5#m%4_|Bzxt3=C$y6oN2dIcbChNUI-XP9Ucc2*Y$xWhnnvDGXrCLbinzMIPg z1k+DL%7@}=M)rzx!{{5j>lDr4W=%8FCZMjf@c+~g0Mx}qt1eUjNVKMK@UWnw+X7+w zN1c@6OPb_XEG@U+xxIfjGr$$*Udp{!+p#`pmSgY%p=o30 zH|aYATKS)Zvoo3hi`TADa*gUo9q+A?f$n?Py_`!;sH!zkyW6|F;kd2hGIDKW)|35c zyTNQwBmjU#b#$AJ6I@UDmcAIC*-E@t#i&&vmK@_^Bdd*^!qMb_vOL#IZcVf9|3oIn z^KL~_S7maPXrs&1OxI~~3k?b$Z{=E>TN#TcDAWxLUhta^^dmC*YrKApa3XDA|2S7! z<78okZL%E41IOFC9I1A0nNb5db<$(9%oeNLsk_m){iM*vUO zL2RYnWNH{d8Qu&6b_gqax~DTrcpcQB=G@pVn%OTaWX@_CS`{G%eLq0;c$w1DI}S8b z5gBFxY}+)IU$?=;H{laEJ=`HEx6qn78}eC*=e?*oZB0|TiOT(AVAm5yZ=^^ZND3+r<<}1?C(fFOX~s~4 z${yqUW5Vr0L-QI&s=FBi52(25CO$~Mp>Labkk+J$ck*vlQ>R`KlX|*>?_|_umZaA* zgvLF1hj%;VaW6N>h5GA^biyWyRv zqsr#ww41S1l{`&?95(I-{!hV4iXAA!h*ELe>Pcx}{Q7p{=Tp&T$;LT^=B#?g&e3iz zH40G_9Tz|>M5XI?{;_3Pn0&x^z%SX=EWPG(>rjfM!koh+F)?QlJxo^gG%!}_y&aR~ zMni>EPHtIh{z#`xYhtx;Zpr8h<(7d@m$$epeGN;Ov zup(gojBnO_3s=*fY4d2@!Bm zq^?j(xI&^A>LSx}H-lS5``c;Q#%dNB%gGbF{iYDQ%$&0wS=8p>%aV$~AeF{W0_ zq0=t>ep6iJ`VJJF`91gS%GNdXg@vJ5}% zRZ_dol7n+4(4s zA0BR8%!QgTf5Z?yQ!y#Z;Hk2wl_&C4avjuhb@@P6t0*YCLrf+pjaENA=9-Wf)g*$8 zS3}ekrxpg#vCIv3uJUK-K!sXHb2G;?@?P0IGE&ktn~dg?99XElbMSD)5`&~t<5rrY zXyScj7toY(E?!h_jASGw?_nB2x9GoOC3KmB$f*F8ZXG01WJNAwq@QC8`Fp#(&Cx9* zBiMjotRNpabKP2BsFK@oGhVW1(C{2fzvh{R@o<{B)1X3avv|l%!;iOY->vigw&5N# zBY$5e6C+EQEN`MSAJ2&Xsh*!zKpn450xn@oc3_Hu~PiE#x;BJ8M(b*NnJ0Hj;e>$Fh$7>*PplWpmzAuFRcFQcGUPSi>X{UdINT+ku0 z!Ko;L%oKQL%Y>QJ>}>An>LIqN5)8)Vt{Iu+$n0rxtrQ+e;LSU>66+l^BfW@}kEoSs z04P@4Zwnk-D{x^92cf>mz3^ z!lFGYP5a%^JHPd~+T2n0Suo0r%q_NpriX@_UjV{Io!~%ZOJ0HQ6?4wQ8EFmbF}XQe zJ_mvR##~BBMN(RtESuc%rN{e)oew9v>gBNX67q0VhR=MeT{n5RXG$!u zfX@y=hQvr+ZIgdUl)IROjJ8f&S#d^_0rH}B{#f2iB0+Tar0>$x6-rSv{ZqBxOC9=g3t~QY*-y! zzNym}&g-^_8URoOTz1iYfg|2eQhFn^_W_>A7swz_wkvVid{oCEg*A?PyuTRwz@@mE~&a637 zevofY6>iqgp8eWbn!wG=&^AmOH_b?XDO~w7W47$xlJ3I#37voNW=7J!(r1}2TwD7; zh!&;bQYz*fDdt|av@|vf(5~o^JCEbmw6E7kiI?UUlLNFL;pL>umO47_4&U0V=UrTb zcN@iR8tzW8O9pqfsW8SOQux6}o zg_*1mdSF>X-Tbg$Cp98g2OO1}t2v{v65`G@A6Mk%4ub;SKcG^b3O%&8`Wcg3B)%sEe0P=>Ou1qDy}V|RP}mBqB( zk&tX6cLT#N*OKxK#gh9JyNP6r)KyUs@In%^NC0ZTboMw@UT$zF_~-oGM41Q3L_(Ch z7NJ8^|L*pE;aEDUT0+P~vG18j;o}R(aT?P{TEV+%T{HI!bNdKg@JC_jT-q7ULF4!< zyX^$==$Q`4o+h;^ES<_OIwJ;3?m!u?PiG?8R^}$llToAUv$`vhb+2S#Tv60S!fp}? z&_<^_$5}8o zsR(f?oJ^Y;^(cDA+CQQ~u#{__FwK!jt6I2IBVx62BVL0{9x#kVdpA^g+!0sXTGDmT z%SUa3w!d*Ep7aqUJK5iFNDMW-%9rKqrA3*xd`as&s zj_I^!O7?tQ+VsW5<6$ALW-X^s3+gI-alPxe`;6zKeuK7RV<0hc67wRCO^D+D;}T~ zB~y%?t?FUZanF1;y!+KR+_AmPpiC=HS?GEuQIXUofinfd+aUs}&eb{@?@jSTnxt-f zofi{Q^(s>``z0w7T`J?K3{6ln0JV#)7Y_APybe(QmjFbP17x&FO6~|d00d|&69ezhVxy_O~G4Cdu@r z2>y@l2yKrdpaZ&2lc|q&pqx>gEGA|{0U|9hC6~-yYu}gsF~ES5d7ED?syf^PEy_)Vq_0QYA>%}~Z^-dlwhTjLeO1=Mve<@Y7r-7)g4YQ9}# zPIZ0j$^^e1)m7X{dq8R$Z)8KY8W$}n zox_VnJZ~|Fu9|k|S6h0BE5U;v`Og{83K|k*d&RxI`E|FgErP0bjeKazF_gl$cJxvT z3!NCqNhPxv`wR>hV=9#FbBfJF47HnN$EPrw{qk*9Z;QUX;!05iX1 zY}^#al1&PL6o2&kH#58DW&rHJFeNPIc7e>F&&J*K6PPs#IMFG_z4E*X*9O{2^<@lo z(@Qq2Mln&v#6ELJKp}a!08gN#422*8vVl+}b8B{FoF9{6Y_P#F;g^D!?<>aHR*46( zA_f^|vsAjRPSq^37r_>{TZ7*pC`|FWzwugWIGIo=K^)%N_1CZFRXP7;aIhlerdmqT)yK(j8Y(QtBh$dl;y9neE1516X_I` z-lPNL$4H!uMr$Zt*NB{>*{a{1G2bs3+u_Dl92h?wvj=O*cxMj;jf+D&yzW9^c3Ly_ zvSa?QxZO`{<~5r#&YV*WbIW1%B^)>NjAvYz)h$MKnCN%-jImbNZa?75hF58;Ae9x7 zn&IHoMedR?uxJ>O0x1$_h*x6Qy$zws4)*H&c(zR7W>$HjP>?Tw@bYe@yzmrX^+(>h zz39NGByIlC#G-36iDk|cN@LFBBtM@`uzns-4&#oE(n6@}M|w#>?Z{CAuKKG{RF*R= z-WeG>o|}1<*UeW1HNXkvcoA@ivr4XHE?|aQupDXX^sv-eGM{KQaY08AAnS5_7XCP$ zEqT#eu;`tBReEf8nkoRk9@msQni=KnnkulQRwmTV%4Fx(zCF5cI-3r3hwxSOs63umm`&{cShqYWgnqj6n9j_le=jElbuFM1Tak)w{5pL%E>CnJe?nd?$HB9rAnX&oZ@n@u zWT7z406n3|_$C`aALwLcplc;P2YCg{B=g%Z^`EPg6=I-AWh795iJ4ar5hEyHj2tPv z7#Q1z7L!c*jm+h+@iMjhzuN4Z;uyD1|1Y^eWX>HF6CmW;VJ~hTk)STCOcrG0`RJ6@ zf+-wzK2%>S*vRV{KHj9!kvN_RHs7r`4RndTotN|g@ex<{tr+kwelzCI3XS$ohcD(a zy5_B3_jAK9O%bMh$lMx-{j?yfO{`uZ=S6J!5-!;x;P9@s$K6~b{TXmsT!+(IAma_L zW}P9c4E<)eqH^oADgekralIj~AOoVx3`F?}J6~;yAQOx!r8jSY8m0TfU(-lx#um_} zE|&e=BQ%`svdQJ{Ipc$4OR}v-iSzi<1cBx!bf&dDy>hbCmpLI%2L;_dT`g8<=B3n@ z2gMiot#ubyuBFGr1MW-RD`gJeugvY6>F^?>(-{LI^53ANH}7y;QY_FM1HaQ@`f>2b&l=J=nv6WTgp~PG`^y&W=+M(`V;oC3Qm& z$m#w*>OE(JVq=`V+OYhp`0z6wWnDz*!&a}glR-UNw@PNO`KPCk8-ukTC~YlH3CpZc z9OXnZC{ZN5l|JcRv|O+H{5gMK+9ya9PY^D0TYpvg;)nAfyPTerexNg*Q-4v&&)?xs zlXA%E`@aV-%@cmBT6+Zy-UNrVW`P#o@(z}FiKaIRv8X-Myi+TPdGW-%7nN-uogK<# z6Z*q~hkXrB{+!JD*|C5V7h{ad$7Lf>mHV1|mc1_T_EYFg=PGjP16RLy&;8depZ^xP zUFgjFs$}|7a;lzX+lVbFF+?{VJn>n4XBK^6wMKSF#HUOLgFk)VHC!cS@+*!Cu{P=c zoF3r)BjhR^IHA2@zcr_tWn|5q>&cU3;^^#Bm>Txl2Dv)7;mH`>1#rvPUAP)XG4SVR zpx$5qrSWqut2{%^X`eCw^%ZBHlgom+ajsJfB*>T>#w&z*uK(Ge=2!DeAK7<1jtx7e z;k3Ww*`xS^e_EKdWC+(^r&>S!eC3r1w0#F*ezF_?m5zQ-@Da@R`z}l}VJDJ&N%`Xh84t zmvRc9-u=kORPNMwD})KXKKVR$^s>#QH<4s07RXU-MemKwDJftw*SvKz1w)j`EzK8F zbXxNCIJF~Id~X4r9$sxrf&`wbK~bB|*tgW1PX;#b^F59{>c8&6BFy_Uo+1r!s6Q~m zXv=DlGdfYOIz38rK-VA~i)KEj8I4^HE8U|F@Bey=nD_@2rpfi?c_vjo&3X=EVUHT2 z&Agg;Q5+>)Y;^BU=%ZwlvsK>#bG4m*k%pI2g0tr1f$JN(Fn;hIriB}t2PwO1{JgAQI?{h|bO1chDy=|f zv@PP@{mu-%U1!T*f2Jm8g#uZm1eOFV-ia>g9Vs!V1~Qq1o`VH0tLoWef8wS+3IlhO z-vaa*94Fv()NJ83)%Yjzq!bU${sA0%9grs7``HNhjD^DI3MWbwoWX;$N)(vq-@cWS zUJ=rgH*WZ^C{2woJrd(gX#AWbdaFU@CIlC7s zMFXjsebiBCrnM@x*h{{&MBA&it*-=wjeP8-dw;aLak(I#Ty^?6@D`XRRJ6KJQ`!2~ zuerAxAUYk1b>GFoesYerJ&Y&|lNM!8kWhEf8H-QRI^`R4j@`E9-#$EXT4Hh`y&t?_ zH#v1R9_6z5Xy1lj$Yq2!Pg-d<`afLWW}8%%+WrT8fIN|ky_ib(tdH8T76wBKFO-v} zx~ZPj1!h`0BrZ)8Zq$ZkG~%d4Z~flrzrFCZsm(~3&DnhW6=QPn0IhFE>3&u}s*vMe zcAt($`+c@15vD}sPedxmexyeG!=N_W=1Iv8p$?!)yLXtewM79L;?}eODmo>UaY;#t zI%vTbRCsvd6yphBh-E_geOFT%j(z!oP=!C2(xo`&&4#bMf4v@XgsGrXmBJyv{yFmu zynvXfnFPx*Z}2-j9csTFt*PzhGjT)I*sPkXj zK6w<7UJAO%i7LNxK7k8)NtSm0GZt;v$)!nhh7sOFWpmWBM%vD+GKOapu980~HC$my zyr+@}8>yLdpptIXS8~x=)v$DO~3ozS_Dq`6lnP3=_sh)ehr$2h3lwMRkUT8m2Yg` zvHu5vbxADQhqpO>O;|KGZRZ{jTo+3C`EK~du7$VRm&%^CevKKkyF4f-o%GENiLyE+ zHMU}>ZMJvCxB7KwDKtR{PL0Y*FIZ-1+mwNc=(r-O2Eq6DSA*Qb+|Brwj5=lRw2y#9 ze_p5aAQtH+Vf>@Dljq7kqjuWtSzK3Vu2)8p+nkxfK)Pyy&s_6x|2s3dj9plN?Fqv= zUlE93@de3QLVjU8AR){;m~!d4t;bAmW-v0DQnX?D!zqj1*Cd(fT?X&&^%|ZtV_rxl zvf<3@+b(a~#B2Gsk?9-^&aZ_N%D6-?Z2x2@aA&>F@Q9Hy)7v-t2WV6<=n!&Tg4mrv z0f+IZE~Sj}r!KuApKHG@>rxHym!3j0IG<1UDjWxC<$adOY7>*Kj;AwVCYDgmb1gF z?)SGd2d|(UEp+01Skf5XnZId9 z=K1|stq=DMtO7SFf4p7Vzj0Skt_ip6|It9c@ZGNsQ-0q4TlL*HUG*-@U$iHecJrQn zI(YH2(J*5({0}fDR0x!`F>Ch+pResHvWC`?tJM6#t5WtB~ zk0LE^ik}ZOJ`nl9WJ?lmG81YZ#qT)hL-2`MzIR71z;pRcWxu8;hoJ60S99m9{u2sP z&~KCP&j|0C?00nZK))uoLUb#F@#$d#=LNxB4v!e9NwZXFd`BprCGWDoC$5RAiHZL< zd?))X<_vAk0bfbRe(_^$?fyeLXKTL&uOl%p*aJz{ z&bRwHis>g*dAHauUup?|yO3)idTqXLsFz7^{p_Cd>ObJx=MT3XqMY7wb|cW4zt?7~ zky||@m;wWum%?q#zaZ*k7Za~<7je_SzOd`iH&tu?l!+YN5o^Ti$8o zr=E^Pb#nXJM9>|ofP)zjbU!0{`>KuZRdiGOK-4lyZEh*3+F?Ps2WZ2A52&O08QLhV`n5|ERAiAquDOx z>b?eSI)+hcXRxlm$=>YfR`2-Z!SQ=f4lnKOL?KNs(*w08dv0rU&+N(YDLpP%MZC<~b&pwWI?jNj>qwhZ-`>puc|N87LM-vG> zg7R7{*jWE}?|`P{_FK}e2=X+I+DAho=}+Jps4>S7qqDgSx#s?xD8h3C*0Wp~(@Jn{ z&=J!{+EgrkLf5M^yn z@1Ek@_r^%{+wc^QZ*Hur=8%BD??KcVDyfGPustng2LJ# z`7PT$u$JZeqIukB+5#)kC6F+aN_)y3Zgtz$eaW zYBnstkT#ei*HDjr6}q3#ii|mLmi?|?Jp*};PtxolMWCfeYr(MBVx&RjE&qV7^RGw6 z3m>vL%zS?(yZ|EoKfa`L{Nz;g52zlhOb~)$AB3}oQXc2L4P``XK>vRKR1_RRKme=_ zBb*7hzqR*xMc_wSUv-4vlM5V_|2_EQtMST{F^Wi^k4{Qs!immD>(}^=KAL*AygPs8RFtYcp`263yeV_JpgQqZxK%KfVt284<%SWE3 z#o>;4Yb1?2#VKW4R+H}Lq;xvR4L{_e!Y3J6tP;`vG!H>{{{cnFF&LmuHyWh@N86SL z+)R>|eg;D`c-A0}DR)T-0-2n16EYb#jx!+VNccJr=X#x4-_(|8z|1@cHw~ zwqr4^Y8C}ri|dK<7PkDF#_nf^`+XS|{sK%6U)SYNbhJ;G@n39-f9_Hs6iV~x)e!dc z6((X{eR$qTPzz)gcwmW?E!WVxNRY~VvUC4OzV8DAEcTji+Or?ODmV&*5kUhd8mE_c zIFb`a2^Iuotl#hsca+2l!_DCIOnUgUS*%JK^7*%M8A zH}oo5A9dPBgKXUqs5E-*5js6JM9!ISe!N23snv(K>k0E18ddahdlLJXos7KV3CFRXD|NP8`}Aw0}<0er)^WA3)l5`sg9uofU9DFQuhq zb2ojZugd^~PT^BCCA3_j2I}$exQf}H<=~uFoinkyI!>*^9Q!n$UlXEMIL#kXuQU37 zPn$eEmyxF~S53!VZXgKZFAWQ=(yAGf$D*rZkRR^L-4Y;Ek4aW25IOajkT&l#T(Lr0 zkPI3K7j&G3m1;wxA2Y4FI>O!LM~=zj7a+M)^RJ`lF67_KGE7BqdLfS0*VO;k=bsYf z&VP-~Z;T%Os?V@v`%1a7Q`&`A%(8>ybyD8|X*89^sPN)b-YHKuJ}GyA>m^tXq( zPl{{NP-xJNvkSe)1ckSRX;S#M*q>0@4@vco$Li&et#MxxSh+b!uIZ^9&*9&R(M7jE z>fOGRkA``M=NHC(VtnBNX$G|>E7W+~{!j_s zxQf3YKeN)6Lqo^Yz0@Svo^K_9d3%$QMx)0QLLa{96W**A+x$JA{NuHH<>Y^PAv za?rnY3(h36)lasH|9~&r6EKow&=J_^$;eN6yZt1eK?NPPGPKiNiU!q}J&=3i@o^dL z)3dB_sV_e#t%5g9{syK`g*vj>Dy8>&=L3F?#T~AR+B~L5b?dwi7x5gbGz8Yq2?Z~{ zMEiYZ%UaRb&b!CE2NR2kSC@UB^}NSf3Ne**%1J_A^a<|H>2qB50V4c)LU_HI#r9l9 z9HVPM9xhZic8`#KWSr8BkFI6R=Zdp||f7zc~^`~wJ|fzY8QP&4=KOYbEonRHP8 zr4vVn+T84qbA?XE^cX6#C4=y#$bN`m{h~6!2*H6B>HW?5H1Xy}(#045iTt?Fc9%!p zRJ1n!-Ev1%zzJ;_0Q3eR|6W^{54fika8rr+QW-BDKuRqCd+CgXm{}zj5>h%^dM<7< zq^Kf;ff5gq&r*?)l91d3ww`UOQZ?DDHx6Ls54aYaopi>?_po+U0|MKT#48hUUg06v|K1=0q(!t%k2z6Wx-Piu_nEp(- zYHZEtn3G23?Mt2}a}{469W2@bHmvUFIPwjL6=c-UpmW%;nMa9s^~Y{UMhy%|iuL!` zDO}Ixjs-KS=A|YtE{@P6N{+P+nK?V7MUxO{gn7e7o(NN34?Rpl@P)a0SoBKQJ z7tx})b|G%D!MHy45+CixfuR&@Xe=YlKsaR+gDBzQ)MI0|gbz1#-Nr)uuiuO`VETCr zGC4VARziI}!GTJv#IK=HOt92|TWI3Trjt3^EbiO!Z)S5bhY@-x6e@^S(SLdP6yaL8 zbjvlYsHC+2EMi}xNN}gf6AK+xD7+WZ%gW1}O zOw1&*J(%7#_Zt>=uRY@1aebuO5?muS2rI!$%B!pj_Ko?#_I2KnMLPD1Xk#$7B2L~N zUx_lEFSOQ$647Fwo+UhpSpx({B^u8rq@w!rGDnqK)IW}gTfx`SoYEZQl=^Kp?H>?{ z<)x?Ps=~0rPzXs8NQtTs&Y)R(atcix6rxP`{2_5)(CDwH^g`&(p+-*i_^yUD2oB9- zY|Vl(bDg5*hUw4Sut6L8QgJajp3fscBqbF*(ncI1$sMA!yr*$6>80O`#cC)6K?aAQ zk)H~n6czoLE(5iS(wK$ns|Phgaoc^5|E64G@f=WGgTo^?#}efL{_A<1lo+^F`IwO?G2LMm&6rNcSTR@iM8Qd7*E~HNd@-umONMG0sRfj; z5KAH)^d`gCKd~$pnLTcXAyST06Iiq(V-m?X?*Cz6aW0KLGL&RPpwGHc?g$#P@Tv}X zca5nwM+Ge6abtZF9>pQVCm?B1|27Rp^R_ zEMf)u8Dkk7t{x8xz`yCYs-bkwOj2VO$VD_a3+bT8KeKJ(x6@p5;@50$?F^iA4!wA}!xq?jJ-v_B?IF}o|S!xJ6Ea7>{U?|G2^8^LGcR)Ml zh2_&v`l&&$9N;O#@{#(Ppon1B6cx^_BsTV!Sqh_pkXm9@fMl$w+#g0y-;z$E7c^== zB!ZO$KQ*Hf0*6I-6#UYU9E)p!p)?r#ewsgvHY-=_O?gx1Et81Jh>fF)ugZ^=GjF(^ zOW$Lru8zZUUOVzsW)o_}izH;4J3OQ^^K4a9U3!%ob0sM$DTF>-V|933;XdZm;MDLI zig0}-_3=8RD$`E#5(X1oXLjs#YL4ksFITyOkHraT$FabzIn@XHNxFS_Ngj9J%id5% zSY;2qOo#DAMtwX^<2%!S+|`(n;E5qL-rrRK{ALc8j$lS zG5(L?5E;-tU?(Q4tj(f9^v*j;$B>4-7K{@UCQe!u<1#P~GI%}g7`w{@;|!_}X0F0T z3TITgN6I%;sAxBy4GbsbNB8v&h;lkQ+~+(?ggtfrIdu$|Qz@3P=6siC8GBP%S+Mz0 z8zuMd_XH}msvAxv2PUtg4C6sWQuXWO4EjoN27GisfBUbhhj8LVn$_PaBxz6wI1Z@0 z;siahqP-s>(=6eEt~uO)q3~!dJs0-iSF7reSg`2#J)YxfmBA_QB(uMxjsXRM&MI2R z!=MdE2TW|YFX#PF@p0c`6f(^gb2ubz%5>r%dU(EEx>-WKD{qc*>`JwG9#zuQ9}~?( zThf;bd;1{ZffgP3T?2LO!LXS2lLmS7XX^Lh_g36QeuoG0;JDBC!Gdv0MXl$Cj zmRa?xfWeIa z2VL(1&vgI(kKcDu55Mh>Fdj8X>n3x^tdk<}8&qhg3Rj zR21$U#+=GjqJx|gr6MZnaR1-#&*%I7{U49t&(j)S#Kym-u-W?4 z6de0_6hUYbUP!$w;?cY2dh)#*jV_J!5N{8_9QV!mC> z>bbK*$PoyLP!z$*<7#jL^T$al%MhK7EzlG25;MMx6|W*b9dbc^v0t@fXiU?~3GZ`~ z&{;w|G86|4JiCE%MI~=~a><=w&Rd#8SP>2VRZXl%Vd>=(*@aJ(nOc4VsuMW~2aM9u zvD0Vuefsr#7KCYe`a;WRL>eb)K0+^an5Y3qL93(9ax5clIe770HSOs*o!PYF3%iriZz*fAZqJXQVZD8if96Gc`S z!(DncFsOXBfZSwW%NGI_AsHSI(e*X0^Smb`^F5 zLw|T{{X|oN!_jQ)^;@e4AHkm+(o3n?ScYZUdCdktGYfN82Ms25&k;8g;D>6G@>5w= z6!$*lg&T3ny>VHu_<(?fx9?D%obu^|LapFHg9anGG%N7^oU*#2riM*qBm;M(oFFsy z{N(pV5>IeoU{TYbEFpQ7{t@N4lAO42T7eR9aBM)?&l}!=VdY$)6%h4h zB}lq)ZBQ|$G}Wkxbui|qNfc@q(tZ%`;c+E~=C-=Sod3(Q0DRk0P59yGLvNo8Gd(jC zmgnek3%u1YoQWxpt-cw*xUeTw6}MLq0{e!JTPWG3eS_t|nw5Pbnz1U+e0D^jG*|)X z6Adt2uQnw{GIJ`xr{_J>#FfqjJw2moJMbrMU)@7J^!FVc!<>AhiM_EwrTo1#r^4@_ zw==z^Q;n>S9?qz!k%Qt1QA!v&P9Hy+uF${F@;TgsDxeI1_&Ly)!xn->lQGtAphTxo zM`?9Ve#6v}vL9e6$Jq?6;}>EH|(0xd3lTduW*iVEuDm$n;!+u`))SMA9lu85jc1_U1X zO!S3lF?70}qs?ezoxPmB1lM+hu!kFt^=^c2hfpYbmzAmPLW5WugI>gXwo7ry5 z1B9Mzg97f%fMuZ>vzp{RUOC~AMg5~vy`aOA(OaeSaUp8PdY`3C`5L&-<7ZCUm?l5w zgic1U^0DCz`*@Vv#%>R=4pTC5_Ie|hpH)NYvpPWN=)FR7{zkY1^rpBrQzIdPsW&B- zvQWipXrULiC7<49xy_8mA(iW-NS$l5aSeRwslUl1J7>C|D59gNC`i=4kN^hEkmEEX zjb~vd`hGxi#bALuul#R$L#M*$dJ_jii=?+n-D4Uo@McP7s{X=R2rQ4nm;UYY=ozSj z@PJpsxBlf6f;>Rm&zwtp0^b?LQ74xh`v^kSe4^#ND`Z-lqTWa*Y<4AnU^inkeh4>k4$aWUKAtP{80 zNw{z#aVm2+V(w?7sf#xm?x^LA_Qn45n~Yu(BGVte*tgK9;j)lnpU*eu87rssPFx^+ zu*r}A5bv-x-Q*)PHkZ;f3q1F^?R~OxO8niT=tJ@g9da^{K_BEFL>p7lfL9kv)jIROCB<*NB4 z+t#U;L$WWccCS0D9c#{@JjZ=EIpQN4TOwLMvm{IhbDBKkH{nwqUyd0QZx7nckM?9HCiHUEaw#pd7#{aH6M! z39Nv~qP}Lc6NH4VbXuSi-=W}<3*f6K-QU}<6#}QnrE~BvBIG!+&`UGa~toHF5 z*E7bt2=|y`*#I4I{gEB|i;FyXi0qcD78R5~o6(PJ%Ly*AqdVnB+&$QAR%m5bh-*E# za63Av*K~f_W6jFqOBB^RXeegJb&+Kbr|ZkQ#}6-YPHDKrs6s5 zzz+M%%IDb680MZl{!|-Y{=>65p-t1+@??NVxmp@aeV~WCiu7Dk1HVT4R;*T(N0X(4 zBb={q9q%-d=es(Qehgcu5?|jpPRr$Q%pQi|avNS>U0_wvmsx=o?CeL@POT3(-9nlw z{Zl-+n}+ri2^l&b{H7)R>-(+GwVy;e=JL)cT~-geRed@qD=v@xfVT_N3-|Y!h`U0l z2?@9tBMxx-ZjRT+URMU)#tuI<4GQRL+L7qkpK6h`BbuLQ0lq?{#5m|StIp*da}Yi$ zGB>v@aLn>w)o4BDAWELsMu27_4au-Tqz$}M z#Cs7!zY*%AjYP2qFBX@6p=pn1gIAprSw+774^{TLa$?3TBRG}tF)ru(?Is)#p}F#m zO+u(#B8~+w3UMzYaBYS9u63;i^F32LPUKxKuleC@8{Clia7F?jo1A*=plecIej3tT zDXk4W<=VDW)|yB^{ir98B137kJH+6;aILr($1M=0N?Lf~7n94#HyNug+SsUuFH52C zgOZ1h-lI*GU|54|s_^7-BR;g3V|_%S%>+6nUL{_o7Tc|`uVK2o(UuE66JL2NZ#Di3 zFK;m|x_iJ)$nlf;oxpinRNP{|H4VDU|8O`a-7E?~tAgi&A0g9`vo8DF6S1OW{`9`) zl|%PhH4wv^QYPVHV5WJ9i!p^irQ3kMW}1y2UZ0<&3PMsZR63og12(+Hcl#BLBQ1&!J`=eCZ3;`P^pc zpoqqAk~(Ycc>lhun4fz}8T4YHuXJx`cUQA|?IWAZNLD)k0@HegV#3bstio1edARyz zR=gNxf!E&-^v|Lqw|hD&`20%mXwn+wtJ}PTLT0qFl8eci0$ri4aS#8^aifx)<(Jzr zmj=%CyZh_pIimRhyh@M=#s=~nAzCM|5U1btXCQkzKbg6#){9rIF(6qZ!`fxmfSImd zZHv)suYq|?5~KOI=HcR$txW{MN@RU)A zb^}4B(Y-!kKxcyC=Q>GD3|-|{og_s1%vy=ZS}!m$`8nSznxTAS-O>C;$}G>Ix110@ zojlo=p)d@;?F+bgghGloDHlAqAO4^~whVJ-lHTbtxl;zbSmLo`^Q$oozug9K>2z4! za~=KM0=S{0X%TN+ty}M|9>-vJ$S;Tddm7;fERINDWQ;U@tI*X7CzO&aEC_D-U@dI9 zQB%Qnty47}W2w*z*paZA2wbb)M*aHH_|Os$t$h+1yA|D-cr2w+=&65|iq3!Prw7(L zy;PoTTf}TGiwgHQ_s%nvQI`O*q*&fTx{^mI%<|@Q(yl1Tj_W}@Oc#@sryo_}kdqb@ zG9D7#X_`0?^$MeEBa-EEU2(@Vax+WfLjpw9nrKWrZ8(pT2-aMEx@9CvbYGzG%(h;` z>^AD_-1Rq^lE+KBP5jM`Igj*yJP~?YHw51FZ}db#HiZ>%{PZ0Zj}E*bKKXuiw{&sz z-G!V&4IBS-^g=eWuo&|dCYhF>X4q-181M(2@=AQ0#v>4>DK?p%x42MNqJ`4rGfNnL z>RR>p&xEOQio905V@>V}!j%9I@bhe&K3JR|fM)_*8Tm#?>cwypNAYOm;Qih(j?#;< z3=Q;_l03(*!Nv@WdL@L`S^vxzz;w+DaEjGj$uL6O>iBrUzyT(*O0(0bw)03WFa3ex z`M?j3cihTf!EN72sZFtYn>zbRLs|J+1-rsc&M5c3I>Ylejg(e_HKgnh_FkH+Y_SLb ztUuVK)Ym2u5u$Sx02rznF)!HckH$Cym?j4qU&J#;x)`LzWkMR;fw~Lz2YBD2Ci8nbZbjo>IiADyoOQ+41O=7KIVbA3 z;T4bhXTEoT;Q37?LZ1kD_`$Q{d8A1InTVVa6d%GrHE>E@d1#xwqK!#z=k>5l=_BV9O|2%0C9 zAF|EUsqk$Z5C%<&2c<7^d&+Q^%7r8J!|}?szWHyYGa)@>%pphbxnn=FWTHbv92PLQ85&@Y_gv zhV9gAS|z&x&CUo=P%e$$FqJ?Nju{3gk%-n=4N<|R?TtPQpLn?ERm0t@uZ6OIe!KWW z%F-Zan>bv3WOPvXp%SJTo@U@O1^!IhOz{x5k>2-hK4dzoN!iAey{0G@!)Sm<_Opvl83>{#JHMZ6E4L z!T~D|m`dl9kbWc-Mt@hURFJRdsE0rh+Y;5U!5E`$q5b;-wFy`VZaL4e*=U+OL$8aP z*T`^C8{ZSG9IW2)u$*^ii_!DZ_GN49`UD~RQ9ocn2{}|})ct4S*aGeOvD_nxUA8G7 z?4zeyFVXJf#X!B3;meiVp~w<~4fYu@99^E8%n-nd;isgr!x`SU+A*`t1sly7lkuxWM63Sq0JsXFpKhQTHGayzis4(5DQ z^EUKd#tcip{j z*qQtkc7>)G!7;c3x)s53qQA(UU5;-O_o}6X9~r?ds`TVR-39@h2I?6k_2JSa=wj}?Q5P(3nvxVw+?>@djI~F?@4PNPV5BP0+9jiZr;va7>|J0mntja zDmOlY^HQ?992O%?onsMte-!sqZPQ|2QVkMjgHWS=-?GR-`~**#Y0SN{dr_^2{`mX@ z)?A5tn|_~9l{E^$Pk4ZR2uW0<`?>xBrkp`=4Gkk~scVBr42J!jFX+*}L1P`j{y7i7 zDUhe4D1S{KoCJuRN|t>7VSXjVBGN#pp^`@#&W6_~MlQIX;T#}zm*j5QaK_)4$lz^1 zKQzQo%sIbS7o@qiI~U0F(;}TDbS35d4NBX-ADYh7I`~wF?V7u2d-Yw=pO{XUDc3)M zi3(VWpOX~67_LT9F6sA7zBY{CtMpnoGmijx$qDMyEdDjjqlC5ahwq1#8@8{u}UHu7(5e8n1T6UxK7gQ_F)` z-%pVmuUme_j7ID9x^!{W9BL}K^MTpSuJXdpPuiCr3$ufXib87-f$52ieFMZsSLzB` z79~Aiy-HXyP06aLD}2FmEcbIt?k$)@o94?JuW7E9x)5v0-WlJtsvc$lGs*!PC_;e$ zeRBt*sjb}8C`+VckI48e^t9NJ3 zlPMH`4qkIb#uFJ@j$sl1sxS3+f0Jv4FXKW7{D)TAT%2gpBLy(U@hs;yO}zR*cU|uf zz5(5XW~EZ%@JtIm*G9ef-LVH8JKVJ*raV!qy~i&_uN0W1WDmEVSFb(vXT~2G*meCz zKi?o=)*afYr{geMnyer=()i5tJm@@+ZyWLqcih`y2sr*B-%9X(|Euf`3yekq5R983 zTA&`|1G|D)Ve5m4@wd7URq)hCf0A!-X_cO~MP!%%ikD-OmewQuP+cYFPnD8`qWl^r zRaE#zJe2}(G$-(=j#uG9G+L2DMfM9*I=4$OMbE_wBZi-<4Sl`ybuMK{7^0wYaeDkSd%$K{p+5X3M%j1 zTl{oc^JQ1Tl(=hcdj(e{%pS>MU`BhDC_G|bN605DtBPx?z0^eRBm*jNdLVg!Xakwn ztIK^dx2oZ8GZ5usxWC$ipLJ{%lGr!A%EITW_e|N0ThJGmn+oQ9nlK2Bj6%Cmvo8g9 zp_ngTcA@6UBd6`BqpV<9C0$fB%EXrDlnB^)%02mi=vzX&!!K3IG-^LZ{A`%$ZZ4a! zbnGW~mfvI`Z=8u)yv{5}dx4rYLe!=GCHXZ$`SW=Oa9?JuDRV06O?vq_W)3fJQ@{Aj z=q>H2Ybu{XjEj>3CIBl+)~iav>3;NO*z{$e?{>)cnT6o?+$x;I*uN7hg&0erelPV%zc6{>Dm zsr=$t@LY{!=2G#Co^m(%_Rw84ddZ;V9R}$VbSj(Jl^~;r-pcO}Ti#Uv%#cWr=`(s? zDd!{w950ncdcyVkovgB~urcmgBj^!AjF-v9??}}0*Rofib^r?EN>|{L>Lxu%wXrI* z+-i)tsx{hE$C{>RHL}vSYY+FE?CT$9?AEAG2L=(QVi zuXNd)wjt|VSYvRRcj0VTnw3m(%re^KM&YEbdZlHwm8~Z-z*>qcCD9Dlq^C@17F*ti6LK2jm4&C8IlhJ3)Eas# z5E28=+jU5VpWu!yC9h)y*z47QWTVgAeCD~5qmwylMDveOyKuEStILt)yy)570JGA~ z5u>}i2ab-ZOM49iibn<)zyI*MtQGZw-h}H#nl03-v4(J{ZD7u31kf@y38T8idWe<}-o4pxbRDsnA->7>j+|?o;I?jGmyNUgTWX zB0`F@S_yF13dr!?=2xh{laOnyo)9`B=Ym=#DlQ(=A2!;1e{?Vx)DvPi5%GeJG%?D~ z3!{fc$#z+H_Ec*I#tyg%@DXxZSvxHL4%E{YXx3`yCoz(+TFI12OgI$0O^ zWo0r^zlhgvQ&AoAde`LNv5hG^4s$tEH?d!^*C`Nf{mjSX5$Jxzh>0s=qK6lyyf61M z@;N&XK9e#wWNds>yB{`t)VgX=v37h4T0VknKXpbFYq7(IhnXd3$jqo&Qn@+%JmXze}GtYJ3AR>|7B|`&1 zF4B74F2qmN;=Iiz@$6^aWrbF`HYN@z7OXK?z2+UwRK@rLq8)pk6{vZ=Gvq^po4?27 zsPO(@*~+b2a3>F%>)&4Gz?xFQePY9u_LgwmS7E-I6)wZle%Gmoi@d+rj#_&J^j7m^Jci^aZMtG7Kp7nVJXtpKn(^X*#r zbEml4LZ5g@s)y@TL;S3o5LDw}{?z7e7sDowbNS6B4_Lb(Goht+E9Q)U%ey0r zkw%?+b+Fg9tyCKu{kE&j37r|5E=gIdzCV?d)hf+&U}&PvXMg2hbsT-E=}SoR2rv(t zZaA$2g=B{-Pk=B0pv6S%-3*Zms$e)90s=N@B|&`W3YELGtAexpIQLG^9ngT%oIaRM z)w=8&3ogATF29v6ug@#ThiHh(#NAHfl@!^ryPRMP66Q1A`r}L6a{!uh+`7ZdaLuO; z^STF3Pw*6m!(6WEIAHQ$uDeNkl&=1t>RI9yaX%57u@c;K>l|QPX^FT9>k7LFcACeO z6?)Z{hRY+ON@NL+x4DkHbShY=q`|DJ?#X3BIZ7OUD)Vt(F3eMAFx|aJ--@P75w12>nBe|=;)YR{a(a)8R^WRjv?$)X954G7o z?-x$kg&H8g7aCxuP`_^veqi)=$8-Mo%xg=npz;K9z+InY%C$J_CNG(^*|{HpigFJR=a8fY^gMKyiEB7K%BR5Cg;Bm-ps0YVHmixL`5 za9RexL55c}{@knb+~lV=WrB52tt$0zomVK0fn2jAw;&t`xD{el+~`P{&GR+}&jHAw z-Rp${66e$b(06!r*pg*3tL!tmm)vJ;Xrq&fseqt!`=e5EUeKIuf#?LQ`XX;z2y=nJEzmyx@GOe3A37Y6`KpTZ2>M!Lr6DY&5`BX!*ii=8U_dzT z+{~(T;=$e+Ql3qWb7}R+Oh`LDY8`6kJLDDzb+bu%e^j#ul2Kh5f9$L}n~jLqXJ$M` zAquQ#;-!N-t=UU0q|{VW(>y^|LZT>V-&9O-2?^=$PH+_TRAfiqN^JF-G&XPn%` zd{6^DH$z4^AatrWBxB}|7m|7_^uteiAo4DKkm;qd>MOvYB~`dgP@Rvc%7gDGHZlQ_Hzu+`ztMy0j`=7opG6)4@R|H& zoVY&CQC9;h0}?Q0W6VSg*E#@IXl|0KP>2hWB3j7#%nwGD!o!Q|kzi<-L zXR$o$4z!EH{yB{9ChCBhhTq;%@(SiA_4~Bpe5UnP9W0=ohO@y)mfVT}ojq~f|K(Z? zV79+Me!%q7i-#%S3V)eWSGX1kPAl#MMXRx}>d&$_x5})^N4Yxb`RgFfBRfyYkNV`d zxR=#&Xp;H5mctg#90KC`L?$pr>VkAP82ijfd*l}5HW}7PPE@Jjn(iO%f8_`4YFs<^ z0`Tw-{juzr)wxW1DqmWaKsFefb@%QY*3$8vT>j{wvW0x1ekrmEdZ_=|A@yVMgC#}- z6r4!vRv3wo@3?jNT`0VZY1-^TTygB#p+kDaINBFzjgxyDddxCzyFS z7q4ZT^YgZc;5)mL@}=1}^ZlC@r11^@?L*|6l`r>lyQkJZlvjYBL>?>_mbVmT3Et&J zD7Q~pY|}G04**Mj#!7YzJn00ii4|_^i{p(@fFxGkF;@Tw#EJ2FYcAF% ze6G>s51totmdfxXTObCl^nMeVLLpNL&5-+3p4nJenp=Tp6U4;lB&>TSQTf@J4*87V zHEb02+CKJTn@Sry!$AK1b)KFVpu$F2YFpfz4Eu1Lp}!l$F?wQQs<^_$IpIhJp% z^D#2CN|jP*;?IA%i3jGfR=w6|1^_m~_NyGt`l8tt=iL@^QnxzmtBmU`%1Km8hdVmn zzi2=n&Yoz+J`0E2JmgO%8Vz!=pZrb7;x51M9w@IUdmVQ6%{4_u0L}$o2)EXNj`DlH z;%oeFY{eE6zBSw(5jVB+!CAqt-BWBf7<%@hWisjl`oP*_hJP3@Fo(*Tvd*1H&Ny$^ z3vy6FBslqR+0K_Z09&jMVHYm@PPW($xU{AVSAU%T=eNBk-&FO5JFA1jcOxF|SXSGS zQ{T450^L9V!GdetHh7!1fdeyV__2CeqFY^QE0N+l2YyzQHmOj;y1ARQ|8`clql*lm zKsY~`Arn&OuEDe64>wPIte|-)T;*4E_F-Pj1V<(pKkzl*AMC`t)s<$&20jd$TJn6! zDaacWi3%XI6la+C71|PD%!x;9AMWr~S%=vGPZE*49!$?gcV)}w8>0;5SY4J+x9~NB z7Azq%4n9p+X*pNxSLgC_!4po58Me+AECAAdaIrzmILrh42BvA>#Dr&!y&U=y64ET_ zXu`GWM7_kwk$Of~duY=-0JP^HSA89~l>aSpBVdrm@kJuSBn4nZRKb7n&{VgjpckGvL)^BzEHux)vM}_*{!$Q`%8_Q`Nd-~ zLErY90;Jw}49mTu=Ug*ZTYQ&zpV@8?2cd z{5tUid4~6$n5_2Wm)!zD=*D&0|NGH@*m04$PU%q8KfkS$ZTZh{>pal;mp7{a7TNr7 zk<@={A^*$4i_`zlBJh8UK=od&6Z8GesttUdZ5w`~m3{zEfl8hSxOO+Rs&k!*Wj}{) zw%Nt-0D3U%^c=cWv&;t=h5A)i`E3CB_cFlL#GW;r-ao$$pH3ZG`cDtnYt@^Jd$rD& zP5+0c|H||98{oDGk9Hu<_CH*(AQCjaj7mgl-##oX{!5SiXh15UCE*%;(72N)xkHu?RiAELUvU$e$TGM|Ajpm~D(NeSj6cVqg zn+m+vOPVELXxJU$v=X;I#25N5Na!7 zhy5N#VASN|8G$E%NhbQ=h#u79{qRK%4f*1ZD9;Po{xbP=1Rh(|a9FUJ?78n}Mq8I7 zUuDks5aWg*z_Wd~(tcseM4M}ST3<)s$DB`dJMJQo5J+^Q@j?Ql__D4HMiyblzBrxg za}EvGHME*uGTLx*60eXl?RxgOlJC`pznR~ZR!*aDh$49n-{A1stI#hB3NaSw=b{Fk z?kbkQ=h5u4qQ!VJbczvjIF8)$Fi>2j`JhU1E{=R6t_GWmPO}G@Uz$p0CitzGd3~gK zw}h-3O(o^%6|WxkDr#~{@up>@2NwjSf6=@Az4E&G&8ocd!YDONVvGE`ZO1 zTDJr!93g;s0%bqukPK#t+LSrf+;YUli<`w}Sff@BDhF}f6pToOdQln>66(SiS*~GL z`;plzCxcebqmGFl>2dN-zK&0zF;`X4$fHTlCFDPOMDg23BvDVP z?6~QJGu`+~q3apt;$nUolX6J4)NFG|Vc4bXO6u7bndc|+MT(X!*7cM`En=)wCz*V# zr{(0X_;JnrySqWI7v6HP1+YbewN1m*U324QHKZ6UHZ-#MemJSTu}ZW5dR z9yM(3N?RDFM6Gq{Z#h<0D?k)MP=dO6wud9|Y!!0Cq|1)-$WnS-v^$A$yT~PQchvKk5CN>C!$;nB~KvwNS`5@?N00kZS7RhRHEjCOs0sU zZ_ju|)y_9JQj!qwrv!?HR+ zhc{<+1TyJD=~P`++}9=RKQ-wBfOi$*Ctygifo<3HScM0OFv+DZ1HMWW}z+Ec_msOJEj0(6R&c7QZ(aJLYmy z!$`7%mzP(lSDcvf4Day~-`*YNnubr?dXpTSpxmT6`bRX=sFSQzup5e(w71v_HD892 zv&h=!;P0C*4P8aJKpBS4Gkyv+`UTEg$+X&=i#;ReW2?EQVJ!zW&%H{m=K4wcpeAB1 z<G{XwZx zAw6~5PHoT*^1-Y%)Fvy>IE0e~b__VnVT(RsR2?KsN#2G~1h!{HU1Q$WajtEy0c|Zc4P*|VtkU*Y;rBmGOX*K?(SIH z1<9oitBDAPK8ru(R&idlMKz|H@R`Sdj^ zggF^4oDNhQGhBGVUvwH=xVTS5ihI>Q$ zuuXI*=j^M^rP|$VD(TuaN7mBKe-nF9*EzJ(|7i4Mu5!&D7e`e*XwWvSIJ?K%@w)NX^X-}k|KAmpiPr+h` z${O@GUe99gPkp3G?gI(re8SarxuZwbOih?{I+~0<5yKW&K!)ZMA6~qoeMr8)VjGOc zP@@?o903QG4oStf63Wetdls0`jVJE*wC8I!)|s8C_f8i~6ca0c$82QQ{k6BFBXZ6b zlxDQWYZ6ui#bZai;1SxJ(w*kY&QGLQneQ@aM>1{XpQ6T3hrv0TPOwl<2j%%AbKr#m!T8+@JR<5k&n7rZO8kfMv~Nc%sKzsBauzRvx;HDxU`Ht_KjAd1qv4run?oYAss&|g|Ehjbg5}# zGHqzBKkd)XJDVsif=xRvWGreL#~lbJV3r0LE{IPZpaUDspY0k!Dd_7HLGL!Vh!pl1 ztQ=oBp@p#6#MjSpe5uB(P9O$3lDy0WuYayu#TNke! zj>}kb``!goi#ho|r#8!DJIueY2HMrxfq`beR80~@8(L(A?U@NF+E?pgGda|L@WIU= z77WFy{8D%~a`gi;RqjnN7#}cuiz9njNuS&Vv9@2Z{Mc1Jw<2Zl3vaR^SPP&Io)}r1fwMrg!rUz0TRQD|zGEP0y#uHX@kzP|#0!9XOGYm)YVf zAjpkFwvN7~hjh{oDKmQ`n+}dCY~#dfO5I`ppp5p030=bpQk zr;dsePwWL7x$A3ib{Ms&I;fCQC0Knnu$7YrIfreKE9zNQ zUCG=o+QXLB~1$I0Rmo?d6Y+yNxQcfy=*ySGa1EEM$sVvS9 zE2Gz7JNx(IVzw^6U~8#%fm>C$5sQCh#rSJ07U8^#nrndPasBpr^EK#@eU|;iqJNQt z3TsCI6z5H%b?NJqnRRnG$dtK3!8SLgmim@83$R*S!d)yLF4t`wy&Lu-_Vby;)gyXL z*zqmd$ZrW#KX^OB%4_ha49R67<|;qo7W-n;_CjlM*2eBi#jhV_#+YZM7oShfvp1%? z!fh4EX|(K{3Fj;1Mvmd^1vwFJi{WbNAI~P(+~+&)-B?uBA=_wQcXMcH4_|yK9f3ZS zI#{bFT_z~FyKWaj74^*!DI1E|{z|rnRC}&T@33vAfQR+DQFX{yszSh3Qk*fnft_+U z4mVhdEZ2l1(=5f^1YXr0qxK9=(PH6|TxXYwy&b)i40{sHPx+Fz_NJj{yO$D~tDtiz zf_%17&KV=depanZSlw6_b!2O!k?2z!QuMifzkFsY?BOp1!OB_57I_5za6Tuqphs{q zSw4d>Irkx9kwnn9IFzm&syIQftr{BTS7*3!HT!K2r)p=|s#!>W7)>^X7o9{`hCU|! z*Z@xaeV3cp#Cy@)M=mVrn4+>ZTnVPs6YKYr)57o@XnOQX7Z{>8myShhz(1ah)Zq6HNlw7 zx%Wkc*;NY^7p}VF=A!mqsB(ZR+d%&e+}YCKfLoBu88JtYhq-@w#3w`Jwq_SejOcoD zHTcYymH~c{U8(8|_8{yWYxPkgO8yg!IrN^B!|WQ6lDNE$nx?0tubb3dcGW0~J#`rnW2woIk5L`DNQKWnYJ%hu!kC z?yrc%D5AAu=_ie#F#8B9G#+S5Zl(KS9Q$QNq{$sFM3Sr}hUtH@7sEpkR-y({I1B$GUhZJvH*S$R8rV3hD85 zlPz6(knqh_L~Y-Z>SIo3B|5RyRi~JX{*2ql)I!^!_otYhA_1g*XwFx*O<%Jb8C-s| zF6%oaoAB}!>MkRryKn2bHv6j*+@~i?TQY9EB|8XfU%yqv4OA^VPvdPSXI@oG>mTkA z_%WwF95nk#d9PGHkrzB=oAbj`DM+LgUNp3~f|)Gex$jhu4mpHO2I-2k_NLUT@M*FJ zZE`s5J!iXiWUyL&1p;sUT(bk3+Nqf$g~EFBclAFEa%%MHT8YgS5Y&n?@Y@L$^037f zi}Vg9+avaZ{2=A9U;<@N{~?ma>%W|BR(*DKux|yQk`v0`{DL6i0ydAi7LDG0pr%|a zh_UQEHAqUDdRmAywB>%$hg7=*Pn!^ua`hn!mfaVp;#$s|rdBwlZISGysOjkSuN+R( z*6#GvV`>h`Hg`wc86cJP+1lgaM_G9p)wWrjMQ*N1n>#(GwG(yY(f;z!??AJg0lchcy#ZswmQjJO!iQx-&9jw{{`*I&4kB z4i4gb9lfsnYKXZ6H5A9zQ_ygejegF&|2Z}81T3orG*lSSC97*9+V?RZE9z z5EbL9(-RTDrTRQ`94d}t*Efy)UX&Y&djYt!Rf&)+uR>T8Eww6oBXi-1#*WT8pPeEt3yq1G)0{=`ws-zl^KHZeIU37S8XK8Fa0 zZ!h>&XMMJgx^Cww9@9W9w&^Z54^K39v%R8X;n@ZF{_KM)MFD|P$DqCk_mYeBPg2GQ z(?)O7_ht)-oY_+4z=nG2d(58IaZpH?gjJ@pUvuk-rfgG2dfA2J{zF-;A4wDRz_hLr zt?0XYz8Y2oWRNJD&15prTQ+Y>0OHvtc;ge1OBVS3td= zuxY_eG?PKII>Nx)pivi=T}aiQ#f8UV#x8(leQWT>QH;(`UpD=Nxg)dvW%|uyab%FI zaaMc{A|%xwrIFHOm7kvmN^x{LmG}@8mP*w&r+14mUK5lEt*8Fh|qcZ!6FgN8x>UfhzXrMx4EzGV!AQVtxhWskRr-wp&*^RAoQr`q#No0968| zO)L_kDt`|axFV2?H64-eIMcKEp-Sq-kC(O&d2cXN(y>YU#r-2}>+I`<7QHoFO{C2XoAgILpmMIWUV1 zYS7zkqVzr`rYV4R7drNcJF$4nwIqrBk*Sh4N9!_BeS%}D14^z!QOOK+0ZJ}vF+CrZ zy=Uxk(z1PnQs6MeJSeVe&qwgZtAh6{`r2KWSn74=yQK>iIYER5r)A{LGSZRklKlqU zDZ22C`eB=(4Aj=1OcC-&+TD;d@F4%v@X`X~rk{*dmKXTg7J0~2n#i@cUN0N^psX+d z4Ab~Tw8YpchjL^O2L+ZZmD#4Z2L6dky16f^wM%K|u+C_^Ju`^j57KzIMJUKX)BkKZ zsMMLLwmF?M(JcQy)81`nV4hnw_NZ&|?8iQ8@N09=OFOxgeM3X|K}-KepNa}n z;=TsgG`fWm`^9!RG-GwgXwT&$eMt={Jg9vw^CPmVg>Z4PtRzdN#eQg#r;zHa`qms) zgxRohUtY)SxZ$EUw6@Aa7!@%_GtBGwlwZ;X7TghJ1~wYXzH*0f36K4PMhxWJrvk}w zN_NG|DV@{$TNP{-Jks%+vd6#?HibcFh47vF8ZqQa(Gg@<u zM>)J}Z(NB|s!HA5DV3!wddaxSDEr?D^q7pR5aY1$_QfPwwqL}%bo|!zNm=GAXuGAY zYf&fF1eDgEWgfr^R!k2L$1VJEg|vr|t0gvoXsb@|7o)b$c^HjtQPEs5YeFJF z;SQNizB=>q_XT2)hd~Y*t`w-qKDweGGIx|1r=GeeGgvf}#H6B#EfL=a9vq*rI%PBs zq}M}Ztw3SyCTq~Y75Hu%`%y0fyO z>=I}-(p2&P|WMV7IXrDuN6a~#k0CtSzpI53KOuDnFxg%29lfnE&hC!0vZ^bdYB^WD-w7lI|JW|xhS_R=?R&C8@_ec zz9E)W&ua*Rxt>Ej@fS)Nh9&WdN}^G=7fpbu$DVGz@3-uetK)!`6Ui}~${Kw!~TgfRKG+}h9Qiz(gL6yu~XsI=WCFNZc zdi<^WziUqlzi3J)BptidMZMZ40GlDam2d2GT zVkNi@0~L`z&%u>JP3@mc&-1RWxn|^x*1)Cf_YUnr(Iya{-oRKv{p$Wv3K4@9eGSm; zzr<;JXJ5>)n_4Ex**!Wf>K~tta1t~5{Jg%LN$TNo@ab#i*)e7OS(<)PAb=a~qziea zy!q63%d|OMMeDihWuIhSb?VJ$4{`+W`2KQ6d#h3ytIGvh+qSWcS(X2a1K2Z6aMJQu z&|pcawdp6(0G_o_iSweP_f?%!6;ou?t_e}px_9A0c)6GM+k3*`Y{Jv_`*V}PeOzVVqsr1<+76A8pn%?vckBR@i`~(~iM$ee z003Wj5?$RI(UjnJ;lDA(|Ddm{nOI|`H)@CeNr8Jke0~~$bk^9>;rh4DihLT`NlB>! z4iMP4r1m&UFir*}kV7q3jDKG!-Nj@HN97~t=buG2b?-b<0fSSo87|%h8)N?UQQ&kc zGx9ecjx|d(NrWhJ3yoP`d?}TcV_kmbVYO8;-0@eV))xPdlA=dSJVL2@fR_2_(VxN; z+w;PdcN{(raNCU5SPiX>whrVQpNs)DL&k9Bl^HZn@xh2%VzHWoOK zP$BuL&@ZXR#-DOOODYxYGJYcB7_mgDpDtf0XLd)oT;4z+Fu{M~cSBMy*-2h)hIKrA z^QHQ~5ZHaqdg03@3$LhLez-1_F|fYRt?MM0as;t1mgtg4yj=UoLftj*ClnT3!+~F*50nkNO;Foy|SV6<_5P^8%uqF{OF6L~%YZ zQ7u|Xyip3;&8(YCD!&uZB}~O~&0dCE4n(17SmibSUu)6#`q%stnA7fj=5!tm?bfXy zUwILCKLxdMg3PGeR zvLS}Lr83_lFcwxO|Nc_l109E##so(prx*npW9tPCH!(000s(Pn0PE_ zMCD84S^Bb)Gtn41+Pc_6rNX|T`F~qxq_dVz(Vf|K6w6K!TP8c^@sN+2ZAUbVr^e!sD zS>2dbg}X%<^^HfeS5E#?g|T6U5pgXh1rr*>aTzh82MBJOuW#NI=}8sV4G>hk)aPk0 zeyvBY)hJeX7G~B_T^GBb+ISJCe20E{vNr)OFHbJH|6D1ZSrp@S13uagRyj6{c-C6- zg(>rLeo=^nrY)i;`rtC!Z>uqS{GciM3xbf2Nz=-^lm!P|%;TaMKFJqUE7Sm~vCDR}mqunOBy6^%GD0k)A=aB+9-23n zYN6y+WyLF`pE}FCU4rns&`>)1YNm_MG;ftI%0=;MLckW+WMlw_MiSgN_+k!##^(fs zn!0pYrhQ8+LLJ#3gBLZ+g89nKKR)WYWuKHTgwjb%hJ2NpShMLgHQe||Yo7l^P*C0( z`3q%l@leI(JRlw|_toeT5=1jc^>HS}CR*2hinS79XB0AoTG&HGR+&(eWIz<*0C#|q%5_@9gz@Vo)nu&YGzfBLbUnFOY=9f}p6EOmDJ`c4k zonH%aQl>|7_YXP(jDH2iD_Y8mc-~)0e8FQarV1TE8q&;XeW8XW-ckQCRUDXVb+b9+ zJMWTfIv}Tf$gf%04*OblLQYWC4)7)#&>0q)B-q;{RvY^Eu9wT@4h}&1bz|f(gnqDh25myvU?7N!p2v55&W570j7nS@wuEEf|;HVoro{r{#z9a zR!i_ISrF;1FX1+2&KG!IW!~o6p8A)UE|hC_XAOxV{;Ar}Guy%dP57 zZYZSr)-~wu8>lNm3Ou$xYg}d)!AjglZV6-Opn}QjB}J?K5v{Jvn7P#J zlxM1+mMYlqa_t{1P&4+EHA1;W%H$z0kJg_KaLf4{z{hF-nMqID-Ev`8ykKrvTogyU zh)7GERZV42=bAO7y7wyfIkVazxU-S})?XGDvzY7~FZ|9sR2h0XR+B>iriEz%ZUn(BV^^?YEl`bNKN!7YT?n{Qo;7P?~6{Y5c5?n{^A zEe~I>7~}d_{^xOTvtp9ix6H7mt2}JE7S^|78w7|15mD>$WEuQFveh_6fY%~ZItT}F zP)CC@o}5>&5DU1?TwuWCHYDkj_Uk4Z>SF}psGj6{4)T4SF`!`dnwh7FqGeo^au`fC?13(cyyS-CY0%jdna2W^~T- z_50ZHas|7y%L)FIz^NL+OaCKAdK%LRieAKeWX8KaKr`EfTkdKJ zd}1VQT$0*zmr6I`lGL@(l9r75@I*rdXlo$rqG1S1&Qso}ZxK(F(&4Bby^}0RwX>Mu zH|t4ayc*+qe#~BK$o#Oc+_J0g@bT=8msMFA0J=&(yI;|&Oe6!19vT>>C2=M_=O-rB zg_SP;pQ>RVSJ13bz57@Pp%NP%05tdcA1BlzJ1W36sYLx%->M0#|DEMuW;6kIdDt~$ z5)ZJ<=|WC&XX;^=&4Vvln2>arckB!`p>rD96rbykCe4@8CRyPN@{V*1bFfz|#__o& zuV?-np`a8%h~}>vUha4(FNPAz4s|gS;*|Y0*|$`R^vr3L&WQF&1IIzQhhiuV$qss| znpqY>LXIsF7sbXnH-8(9rfW<-AoDQcL#?G~yB|jo zQr_4{9#zS!DNyUqjD%eVont=#Uo7nZWw5iHV-bLWR1NJA(gB%_s4W+o2|3481 zN`~#UJ%AJP!bVj~d|8uH z)kiK6OkG7Zw$p`2R-0->r8)p6+c%VCv^iHX=k%sh0AGXU9Fl)E1jHDq|B?6a6iQOF zf{=n~Vcsz_q%MqkX1r+FIgS!)T7ul`(SC1=fAY_Scqd)q_3VijhJ@2q!iwPyYFT8| zs!J_=WUxfWwd3K2wVv$FTP&(iQ$nwX#L@j80RM;5a6JCYGPP#5q#o95Fs7NGZ z3p`P$*)_jAX=*qdIP?&kOPkv4UKJf8(tNw9sK5$I3cG6l1~5fG!$sJ8G)|jKlNPGv ze&JRtl=@oK@=}CsW~jJ5yRi4$VXb>^9Xp;QAA3w{8!#aaoc+f#nh&o-Wgc64$BZL4 z5A`h&3}gSOc+nAd^H_Nm;QK7eLp{&k>*`IRLych-OFm#K7r_Wr^rdvuSuei{Z8 zFdRy{ht%5G9qw*7$?RFR@9cU>`wAAf7O}kk`|_mg+47_w4NDyP#Oqu4W=^ozyDPl- z9#vakt^f8$n9|`n|Co7C(v1Ph%pW3mT(>P;ij%mdt3vxGbNhrc0@xnWl?$lxg4^0O8$Yo zuq{KL%8RCIgOOKz#u0i|W+LwLuw&1Bzej|?Bi0=vKYQ5%*A|OJiilK1kX|UE0e34X zERTB^=umhd*%lnK`DWJe@l9nf!^3zhQeMP@S69|hAJ1u}zdgDIn$8kvL0v*`6}P8z zMZ+*PVb7Gf65?-zuipU12=H$R|K{504-^q(P@4QRy*l(9;jNWht#04#1F`H+r69Hr z{LkINx)+_>YcL`tE`LRS&T&UMYEF@7YL>mf254+xPw*O78G8F>ilMc~owo zkWelz`1Y7>SLg;&~gDU&_G^cthzx{f=^Nq@dvLVr{iC+ z|0t;S!ZaxD&7fN{|4&4^9f9?{DU4?oI2g~~Ri`8%K0q%%Z`f+M$7{*fJ4E`+BGfSt zS+3@pznwHwdaUqEx;w+u9gG{vN+1}0iP#JsU#TH~otA2P@0Jx5nOOwmj%bucQbcyWVv&0+kLN}%}0>NKv4*5QvA{%g>xIC0z*0WhS8GipMD%jfz~#y z#yhSzj;u#U^0%qSo;OnN7vw#@ckP%VYGli4ZJXZKji{Xy9a)fZjF(qk;(d&!@P7$C z=U_v*L~+hp{}0Z&OWMuk?9zu$FB9if=khZ2<=u2M!#HChedk3FcMYcYn6&JWfC*dUs9hx)blL zC8qoEh;|MzBqQf31rMa47=a~>Cdm9f=ZUZ^0hDRE4W?@z>N8=8-{Jx;Q%?FL1=-?8 zAu!|cS~;pUzGef#4>^%J{GUo}*7pJN7qB_D0UOeikgz*fQSrUcUHZXlLC)A*s&^N` znB-LzG{VVm`_4~zpBk}wxQ;(@>Qz!)bz7bkXklfG7rgWvaP9!WPv?T8uz`;f`c)<# z=9xVB{-@zB$c|!ZH6^pd1zJ%*ax#RfMP1jM`4VmPY^^k-<>RTXw+Agq{5Fa9(;!OH zOp@jwHQXh-C&`&!f134yuzgT3!V}EzJRmGLv1jv^vvu?Ss?-?ggIhRljvMY#(2(lA zkiiT1PS+8fKPrOQ=08Y0M(m5NH$EXA*ZwiCr`#Noe$p5w4EIjxT18M8Y3{m}B$^`W z&}w2(tCK4wdSDOsIqv{_I>|DZA-~b?V$x=DsRB)y{8St9CT|rAbdV%kU756Tsis@{ zsOlu+*#4yc=xAaUH-qqN|s}DulJ}X|)Q{pMcMM4N}uZM~Eg0G;( zUJ!}l888FQM<1&$FtVo0Uk*8BddGAvBf?wU+iUbsPS5yg16v_I8GUiOV9XW+5J zfHF8rs-t}K{iN>6)0*?lnQ@PfJ#j2l8Hrc$(5JMF{E*$juVo!y4^7xMoBbh4zDF^Q z+BWyb6A#)P-AfX#e|lhOI~S#hhj~q5Y$~k+<04fKKuiR>c!I7?qUvN9V6@MxhZ2R( z+nnC3y(+x`VccjEpm;gzES`P;5R# z=x)>8M5sGw2m-*X{m^cw+Ow)p!PigX)w2l1h@*dg%4mDpT7`*BYfgc*sZi6bi|DR@ zwgE;r+~{+Fbq~v6eLZW9>hO2&sNop+5c7IG$puUBQYejB+cS=Z;)r$|G-t8`R^T&&OEY}=i^_N4k z!$Kb{^>u_Za$7?X6M+n0FuuGjRs^D#zp3f6OfIa>#+_L+(Qm|`wCpJnY@ z+RXTH(sxk*8UF$rE}xHS&(am0E)viIx}f-F=L2%FD3N;`|a|>{!lfX_##|=IpJXWwXoAqdOB_GIA7@jwTK}RZ3*+g z(+$zW_T%U%j<`6oH%I4+zi9OJXD1Z>e$Nx<<7b1_$H;XeVLsdwAo_GVuKzyyU(^-k zzzv~4hl1j{^gx*(CKnLZYn^xXK&?U+VJ0sj^jv4yk+R>K01>J;EL0-%@K}XogRFKN zrYt1AyS%Q9ZaEAS4l=W-!SEjNjRcyWZa!*Q?b|}i2TgqTt@3TNSURqjIJ&yePv1dP!jxd#8Ltv=f z^*_;^t|Q!i9BIdpW4Yw&CCl?gnXGhl?*KY`V0=x2AT+7)dQuigiIvaN1zuWT0lr*z zMD#Pj{E`denL>wkg4d|F6M^Ormj|;@HTjb2m2x&&_*lq_tlfnELIa)OFXf|<{u;-- z>`LnbX|sPU)>CNYwGqB-OrGAHaCl+@Q0y1Oa%j(Yr&_#Aj5q*WCrI&xBz$W=?Jhz} z=wYKY1Cf2vI1k5HVjXi+x|vU8tzpkl@pRd7l$ijf(oAX;=aovqNq?%zoB4%5dAg{8_p&DCXVJ=ev&oQezoQE@Qh2kEej=ottk|gd)A9kKyqd8 z&gdCOxVFCPkh(W9b>{b}bF5Q!e9>p5bAR9U&|dkjvc>gIi|aQ%gxX3?#T#6-b$cqv z_p)a@UmR;`3QYz)UfyvBB`qY?_OJbHhY>BIdC-1Djv*r$StU`IwGV$Jjia;|6eIXp zPpTIH+T`diH&CQ{Agbf}XWTa&%9mSmwsU0-WO-`)XKpU#x{H#tiO7e-@VkITWB3j&F?5EHM-M1iM37j=QXwD6mmwhGgKwp-3%@Uh|o2|%Ji z`d$b=`x}-CYxW9v-#+Bs3lE4U>qdD^D?2FuHxQEhmnFYHO}GAtV|GF(^~H?CXLYdxS1Jp@LP z?sPjj&o{@B37Rc({~mjAEyBMw%C#Sfo=^kAdMA*K482&DFlc-s%*G`YY6h8N1}lPkH=I z*~zlDWt%ri^t_72G7eBgr-diN17`duDf_wV>;KtIrRF%h=!oB}?Hp>_@0=kmq&mWG zvRTzia_0(n9k-d8W1`8@=>cM&QMgmEH%!mD9vT5TF+4Hfnmx29#ov=J%e*}vx`6K; zdfCC*&7DW_8FA=zSvl|sHPU;XejDFwOhp~Ksr_YvHk_3#2y94}Tvt>?(DqYkkE>hN z7LTqtp3YirT^SkhXtZGX1&K_GHo^~FN=MVO-k#19 z^sO?+!?l&|lQGI|eXv-iWWnzvY$kvz@ghsa9xnxIxBf1 zHEt)Fn3?$6xYgjd@_U4il$U01o{#vO-awLuU1Wrkw1 zPaWlmTqh$gd)rQ(VM|~h>Z)+zZG3rB7(0g8ontRg%o%wvq%I#qH&X?Dt8DT0qCOYJ|;-{I_my44C`Idcq2C4Zt(o8(YPjn5|x*8revN%U|z&xK)9Q8krRiK ze_60c@9_qbA5C>LSOcm#mvj%#J&_1yNDB^C)!>G_bbRClaeF`xDZ4+0CoWGFB5rBJ zus_VpR|u{yuQJGg%p;ssKcz$))gE_dVk&Ppg=)R9~u)7HA9a9Z|!=IiE8~s8Z=LNBfSV+S)G1dyZ1QF z^NO%h)+39b#6LpF-8MjSGm#xPo1JVlS0G38p01b^Rd_Gis@@qnF9@H{mKbqxC0dDg z3$mx(4-xc+#()Cv=$%qt)UQ`$;Pj075BDRi2=BWwT&$$XrT|*;IdAenGa>+k4 z=B{aG-9%q+WS&&M=I%7VVYug-vJor)m!YF47vLkn@9agbb5Ana#)R?m{a)=qy(`j- zJ9IuPDaQ&d1OtwjAmmxhYUaU!S8kAuTFMQusgj}>E%NDWurE~H-?qB*L(==~^hyO0 zd@oHmk!GgsyHoju=pMX9+}~{}Z%lLB?)nL<8HS^Zhy#gPw=vtO4u4P26c0t(OuuU( zuzWpfmj~DYWNWD}_P#d{A9b8NCn+L>QKKmmht?w2-l?8sCl`2!jo6d(^vyDW4#kR} z2X?05tNr7u&y+aBiZtm>GkuP--Iv;9vWmz5S6dZ)qm?gZy~@fmc>Y9KZEtZO5>G|% zym+&3#))#5^-p1h)FWmJlR%oAP5#x#?fVJe@YC3aC4sH2CkoY61=26Vty`@pocbrM zmIooXC|t_Ua~&teOH8~&Mhywho)zTQE#=JnHR71fCF^F$vll@{p*35mzbsk}I!Ngv z`q03x`Fq7&(WkvMefVFN+%Eax>PBA3$>60hF2Qj`o1cOQB0`{|RAl)uv)FDs52^U( z8(N>8ve+qYWjAjV(qm}R?vebRhP6R;h_i$Z60?&6FZI1^P9tw78FCtrM#kjgKY5b8(X zs|&Lt(sgsHFR6?NfPhppu0`Xj1sF;C54QCuJRKHVEQZcLQL|;I>7vUp z=ud@%me8MMc5kITv@tx!(app}wYJ|Z6xHu65UOC_41;epIv@;=~zwns?04N-VEEN>S!y4b{Wp~e2|L? z--}5f`#^r28Uk zIm}_e@4!#TKsLY*`mrxGvskdZ8c8hn{uWV{%W)JD#6q-<+6sjA?fEZ4Rp;)p&-mYR zWt1c9r`8XK$&_;mpBbn6zb{6Xw2MWW98$1qmt{X0UAiUzQwy@3d@rAHMYXiHK(49@*M|^6LKo8X9FBfnB*3zJ+nDIlpfb z6spwnDv6=lC9o0RbD9jwpakma-as{k+}7So{_Qj5 z6I|=TxNaIf3OVd-Pt_cc0z94G#iO9XdO-&bQgQufyx{cIV$$=_LNMp?%c^p^H{F;1 zdv#*DrN5n*XcMoWsU}SvW2Ihuh-MtDDtEICMu%mc6zLg(ShlDa%o$ghj(PI{L}^&xbYazI#!FdC`Tl%El1`{27`?xS@o)NHx@7qX za~l@iKY@KgnHFOp0&*d?++$tlM^9r{`>L-QuHH>^e1x42JcbIASrlKnjfzae*PaQy zQyQQE)`^eWkHIAV*Gz0(gym*x=TE(S7PK88G3YjgVz#T&bw}mj-UNs~o9*rDRnVSy zq{AKBA6GE~`Mv5OVxkSTD#{~@Q(r>vpx~i~xgo9jB)&cn=z&`3Lc$TC ziiW8<5koAm#y4qR`~tq7;QU&b^BnE!>bM#bFl;v5F~@~zwZi*G61x1O=o{j_5+i|j z9!LNIouLyD8@gPG^GY5tP$@y`-SAwh05*)B?G9)HhQPay}_n5W9t&&1FUv9wTgU8J z2p&qBoTj<=^vwA{%TuF;`pTl(H0f>K$|k?A69-Z3_Q=!qH1`Y*GDF!mc`>Z!H-@08 z&$I`4-5rK>60Ay{ajtjPbKU*lu=hS*^Horo{$vYy)HS=Tfa8KbgbG-U{8&p}j;(iF z6q#n}x74O2-Ng_}XNOuZQVnV2@V$uo7D3G`l(j*Wf|dPDdCpQ??Ic@KLg+(b@gCB~ zxx+@>H=8{+TLmysfj*UfYc%_hP7 zVKw9{2dH2gf_eUwGIp*0jZto{PH!k|^*8$d33IdO2={%tr z(xEEz;zgt4XRh+^s5`ut2MF$dTNq4C>_Fe+OAA#9hu#=|BkqCLcLl-GpT(OF1%LAJ zjz1kgyrZvL>`YLb1D}j2FivP71Xtw~%A#E`}!PJnc9! zt}2PS9JCuG@yt~)-b$}UIfqEzOif?Bwj&w35P2>h9MC{3_1D$yU(!QINyz1fryOhK za?xaGGV1nZ=nvPai^o}9Tk4ZnUot&xR{{ldlMC}Kx>NrZ(9o~f%kWRO?Bb1nwx;WM z!B^rnFURZzW<9XOzZOgUK%;jAN+mmIg<5`Cjo-d*f{m~aaRSd$zh{>>Hy$TN@$nHU zTn~_8$&>w4Q%7N$d+6-ZSQHQPa=~%k0l$@}o?{_Y`=1*%FdD3;7mmt>d#Be)mX9fF z3P0+FrZDi{3)QP3vCy@{e&~QvcfRrTU`$(A_G)Ar4Pub^!bs3rER_4WUbsA2Ch%U- z=SLoA-uvz^4Z{W(BVUw`c%kF645@03cAB`g623%4j=+XVH1lfBP2+h@TYJp-f#|XF zx}&%bXpc~l7fL-F<$&{GmEy1;v{Q#NKWU~W-C;||Ss7_Y(~QuoC9d($*=s{RNr z^%%FA>gRHFB+F164U&ZI5Vy#_3~mcxS5qy86t@ zW7B2k)Sq|wt|(>K$WNJTfguCw{;jYVrQ|tK zG@G~D?e%D~ejvP#j9v?%p|9Xv>T=T~UMUGKJ&ezq4XKauL(k<|Ht0s3y?=icS_Vu! zJU{b-Jg)bJg3ina4!yZq`QCDqI5du%4RVpgq1aGL_+~b>j_UAF%>;dQhkcVKKD8Gg zV%_#vE`5jHTdPdg`c6`i3Z(mP_ia7iQ>Sk>6&E~SQJkm_QNGJ-8&@_Kh8|+`_}JSq zpN(idbep$jtLM#4cny|8F!}DehH}~J8cq^iy?6b~xXaqgn{( zi3pe7JY;b8rm@=qHcJp$2|4AY+ms5Vzqx}cn0gzN1S}`u3-GKrvLAUNJ`w9IC zvLQZ+(<2T?^3`MnqjPN+hYwjrY-XH>&MJkSsm(iAa@{cin#4r?NE2&_Io!i>Shfku zEs%Y!<^FyZT}LAFhY~G*Kb;LqITsSGPL)9_wljp$6LoO?#gKh%dUVDyc}B5NHE}{E zmqtb~+!JI;nE@J=XME2ig~#TAf3m^Pk=WveA`-9(^+JK2;Z}K zdV=4)ja!!Oy}cSF#&I~$@OLM-S*1QxP@s+La%3vzix8Ao9`31w6+-pl3nU#Bm@D3U zW*?I%UDGbGmS<3p56!(3<1ED`AP!-`lrp zz7=L$$tm5usr0Fsw{)6)ppn@WDkb#md2_+X7;gq8o_XrES4^RB-`&oUL=ijNSRC`$ z+)kU{#afky-_HF0{$IxD*0^6}PFO%)bFo*rbl;vqd$)rUjntJR6|^q$NuWud z{u{1_MEQlnRHh;@zB}NoRP;j9rKmC4>ag}^WA%Kn04Qj;$RIw5T30pO)Ar8mE26Sv zbs*koTU9!IYRdjesenDhd)fQ=F1@n3+6IhT@medf$Wsxm8qZZ;J#S)i9H0H~(SzOr-JhvLRau^& z90qwAbrB?P11)-IbJI(hj)(M~fpU~E`AXFF5pmk|Q2%LOYC1gpJIOTq)^T#Wh?L@| zcacfmhWt~_$zLfIlD7paKPyT*M!@#tvkx97-#DD!1_?7g!XrM~X52c3Hl^3ope&~U552fo`_ng8o zFloKc4YH-ij~p?@Q2l7V?5Y%=L-mD6UuN*s6aiZ=i?>yT{bzj0KUHH#_=@JJHfXOx zQgInz|CY}I%>bQ zwO=&!{?nPVI$s$jSZwCC+c}Rc|M0wBSiL<*MyA!h<6n=OgqFu(aN6_f0d#F91ZpXF zC@UzteexW=DBA7ebZjs_Jm`mHX&qlgpZACAcffdRn7aDKm(EzJS%y??C za>!uU*av%yH{fxIgMfnh9aRDZ9uV2hlNXsN#dcz|YS8nw?8HLVVDZY$qFzk{@#WF5 z;-5+dsh_7R6Dd}%rd+*2j8o~&mcK+!3$=U^Uy-y2_rkE8e)HoWCXHgGnUC7jmB1cnDs>Q7;T{qXcu&d zTLlapKC~hlYu+31{FH^bO3I`eXX+EP>m-Koet{h#4P7(^T|>WyDxXjVlT;P`ns4no zC}oJ-pKV=fqHE$FfYdFDt*g;um7cOXOu!H9e(~IgI+>~?3~jnn$=|9@XYuB%yaa{* z13m6NzM2Ky*4GW*#ylA+drCJldNB^X&8@#1wlD0a-MpxyU-odI(Lc2%rN4hb*cZ@< z6YNXRTxcb~zbK63)kSB(1;Szr*NfXVrRlfet>$to!&Jq>d!mo}6lQw99Fb^vmATuw z;#oW?mz^SU9>p8_5(zyq;(M~+10fy%(%xC=V^Rk&m^XAGoAa7;XfPxh>cyrh(BL^Z zy)TTuO%GpZ7G4L9;E_bIr#hH|QxLlDI)V1TC@I7r`udnHwt|E5i;RGSu@89X17&T@0 zPGR^$VO=|a=XKkET$Q-#Yhei=UHc|tgu5egqPg00_?Areml(MxiHkvA(&lM2f5x!Q zY+m%)NBjX7lwqYKq}I>NBfsc2@{GvMm%nq+!4KEed1^bLry}ZsAM*Ma4@4O*-l)ab zUZ3K3+1gk6%d+HoqNwlw3TBAz3wQE~T=lb`)GwJ_N|K~}&U+uNUU+iHzdCJjp`|cC zJK1oR5i)lf3Q>X=gFY6Z{S>tTcu=5d&7;uF$(t&HTT?4 zbhlqiiZ0s!>?!5$%Z_k<&|HpC9OQTZ0mdd3^UZVp z$(P*pounij#^!U2hgU5`ynW}oVU*@nPvTSR49_smiVO2H&87ux45!9_^-?Y`kT=dX zi4^Kub!nRy{C14Y{;B(+RoI?}5);5CVM%jfVJauq!s{=~A|_eWMu2fGG%wJ`u%?|y zd^qyGh_EJ~GUB7#3ST-&fF=!AbaaeiTTW2r%M3&THsAvV6bykr3ismf$rNfKEl%;% z^7V(sta>pI%!}G~2r$K|TDYI>`V&}Rn~0u~cr3k`JTdT>#UVZO=?)7(^EGQx8s1`o zo?r`BS0Yus3#yDA{Wo8Jun8d%$Ch(0t*1$FF%?t%=mZTjX@fif-qWjEe+e({*g2Gx zviF&hns{{FT)lv0(8iI%y6i%jwx+PtZRaeT+sD4>>bbsEGY{Z_op*6lFa>))N@mR-?>)IJetTqM$>Nb(`B$hb~Zimf2R~;FD!#G0Ns^*O-=tyyEr(LI}?cSPLsGoaaHP( zCKJ%Qi(}s5U&tFpg&U{u{_&^*2mKL zRo|gk=0U<@jE|;S&VYizZcrIt0QUjFnEOC(qW%~%3(ew-F%a_^-8|{Es_AR*Vjip= zOy4`7bU+^Enk=HFH8H^<9PD>fw(8o^jewYz17F|{2l&FBwPgi*VmsIB>~OyNURd@4 ze-JlrPf~46qRBL<#fjqIliocjNsH;U&gWcUey$VhG}GF;%s1%~~2kOf{6!)_Yxw8X|IUE7eAe)(~!tr3kHPO}C}h zzN+Sgrp6G_7+OV>CKY1`5(FV4i7)qgzJJbhp8f2-&f0sev(Mi9{MK(3-(+u^Q53Hw zD}NjLQMI2N`2aIM!QNrFwIpDV`M0tN7D~d7fojq2`vD#FCppUJ; z#2vGErM+S^{mI=&yR86^c3NN{U_cu11eN3^|DdG1>Ys?_o7hj1UH{nxo2PnLwJ)>I ze*-D)F#kT|^%{YZd)F4c&N{+c%M!hg%y@%Qy{7|B#CLj)b=k1oZsNosU8Sx(93_fW z#v3tOGc@k@kd&@4uEL~CqnEIgt2oW-1!)7R=IUn*2l#`UtEa7fjjuF2hG=vQ%+fvr z9Q)Ts*1u=$Oqb_lh{sKDn`@Lo?=Po5n@CK8%UCB{kJF-ql9YYxjtToGWYNqFpa3Wn zR%4Xxq6T!@qZob8VT40RVtupot&ZTD;Hh!~o3cZ-Q6D>p~+7z83C?wD(sYRE-cM-TjBkR4hx!33^ zaoHwOhV$42cRllGMlKI+GY$YJ9#`RpUm<}*&GfjU1SH8F2R1r6RE@1o3p(3f^(bQE zUfY^(xn;|*=!Wa+0ry$cXe0Xq-YJ{9lW${8ifuk`LEtfhM_7I;0Y7*AO&J#HpH?3lG{sWJ(cVTUBR-~i z7f9f(R>F}d^49))SoAzoYw7;Q!6M?4j?hD6p(6G-2IM8M(O3{N7x_JdTrrnRMJ%<< z_axAE@Xh_wob;i`d3n%*P@n7z$12$?c5Ej--Q;^mo7PDA!0uY zWA0T%I?+sqLqk?+8f{cBX`~f-_suZFD@LLKZLs{K(2P^s-}9Zkno>+hG}D#DZcb2O zd7^o02=Ogi@|J~}!+B~CLFy|y2D5I=?vdWUi1L1}&JDgko&>p+N_hp?{q4%Rlbz># z8Vl_EGnU^u3Q2(PD?w7$1O1uZM(H*EJ5wm1Fg^G&I(RX@FLuL8%cw^o>79}6j|XkY$kOoZ_iW{RI7eblqz^R&r~^H){t;Ev8+RYNn@HqziaUQB+kl&uqG zP}N2vs$}4+b(C<#xeK_E2&5I{@6Vh&dvk?L_`BAhbQsnefpl6`cU#j~HyC*aYZ7hG zZXn2{T0^JWo_DPTEy>ncTzd5BFZ!TNw(5I+^E@Rta-Gmi>l&>nE1O1S9`N5xE-BHJg+FcPgQJ0cz;6zJz1(i(6ovQ zp-<NzbrJ?|NPJR~9&hQ7`IzQ!3!hWu3t)p%69y;tD?V?tJ%prEN3kE$Gd#~71 zE=U^?Q&*|jzF$=G^QFFJcIu3NPPa|mLkuvU0pbVm1nn-uCJrH}$tscJ=spCFh@@$o z6&XZArz@0>w#l9UkeYsvL-wUN?(<1SG3#_MEDUZV)4i$Pn(}6U$GeI|9 zRYonkWJ^%)JJN4tBXsk7mPK&WQrRy1$ZW%7V-Y`K{~MW55z~ELum~KO<~cuY;g&pxyF;^hv0fZ|geIh~;&#?qxzemM^ug|Kpmh^HJlvGzj(c zq~jN`3T$XE{hpfTuF2&Op^7<~PeO&oz69i$_yh}-88=OSpQbqw16r}jSSL^PXEP#m ziizTgfLL3Kfzv$u)zM(tR2MQ*Wx6IOBi(D}{p>ItTmn_yh)u>fQ!Yg(yA{J(! zBCn*T3tD*h0byrp*|2=9%L~>&*ON8u-}~*}Li%nPP9BNrc%4QYt5K;EChcpAKbrIr zSVu=?Jn`I~K6)3vNeUle_C2i8|32L3wg&2W&{~v0CY^lZTTPRZwFQ1*fB_N3H}ru| z%YJ+0m&iH$J5BGE@@q^lqStEI?E+13V~Da@K#(3-hs9l<0!*gUzag@=s}fmN?g+0i3$ddH7) zPKKMY6h%#&cmv0Ig+;*rm7nvIkChof1gqekT_lfHA%Dv!U@B=qHwHnUF>4hyJZgTN zD$@Bb?wI(%V2Cs0?il10DhSPSPz)>kgS6Fe=}L#n5?;}kGndS)mF#;5{~l^0{EB9& zyb^d-4ah%6+&z+ND7(4Za)HC9~{UB@31)*TrTQY#;Qp+5VrNJd1iJH#7{dT!1p>vu~Qf0{-br{b1 z!B?0|%*gZA5K*}-FXS|{IblLayb=NOV%@Fj7+W0}HV(IA)c8t4YihWK{l|&to@UR& zLd$OqrqZ0Kjx;pu?Y$i^U zKI)FlE@~mJ1zS23FDcjNS@?)R2nYejBAAJdha>*Am;zjc5<>#%6ufhkj2ws@yokI5 ze45ee*Supo^ZVVKbSMsgt>7rB6ezFpe3;A}+4G-tcSVqcb#a=ke=gf(N?nfoTk{D! zyPyyYiFI=&vb60685M^Tua{VHlhJZ(@=j5^on4^mNVhM0(Zl`=?4}1fJ+kS6&l4G@ zuBErT|Dh##$7%+easLDGy=>A{+)%oaw|lrBX3x%HZ{niMtyh@J9ym*j92u|YxsW_q zv8|iItw)K?v$eA1fT@mp(}AvN;~zI_F@6c6%~hoKXz{H7%JP^GIx}O^&S39v{pe8& z-}v*cX)C9OX9rS9OK}ndZpYZUJ<9opvGCp4R?WRV-Qs}})g2ZA3|ugADQSqha_?d8 z4R2YE8)-&V;`F1O?sQ4d+cUS1K&`J}6uhUkLMj=jp|#lqJ+13MpxIyUAWyv-`469= zyr|J#x)U4F^MWQR((*Q>%d$6^^odb1ZOf77Me=tx-QU zf{4zxc6k}CY?&zt362kp+9CxnNx%y-PaeDaY>53YB>in^p`Ak^cBBU$G`nbZ3(bu7 zRdIFGzGOcS%ulPU$)8ntF?bwm2P?IJVarBQ^M(#GHYYb!&BOD0xfU{>4!RY`yy2!bI?OroCeHBq(cH*F zgBfdA9~ib~(3;tkz&p|kWT)|zqS+6y!&8P|)E-`^5`8c_r2_xS{)zZ^nuR5CKI#CL ztU?_AO~)_JqoYOs=Nfk$mZxtE2hN?{UOI0LMP6nGN(dQw<9kXwhDD~V4hdemlSfbZ zWIP8xkFdv9IpI!?dl3saMA`noLn4 ze{NapkfE3LhO@kAl^b>=@_t^@t|n2kFP2y|0F1ceo>Dm(z_7BH_XA;SCUNTUvIW27 z(zXeZ;I`dPaW6r_9QW0QCg=3#X`2KB0KdOjIFZNpR+&sdCQdi0<=B~S#|9&Pc~5;?UJJ4fc8pl=Zs&9t zTNZeqiEpG^Uh|}Dc?Vpdd(s`%J4z{SRJEow=`;tatwe*%d{?ZG=Dw$Z{)(cI?3Igm zk}bX4{xT;5)&5pY@{CfEwtKz8%Vluyu9MLFiV{1;R|VD=s=bbu%x|oJW4F@hzi#U8#+ag6 z*{*$icjn6M8rgF;bFj3s=5guF(d?U}PV@ZSM7*C{e~hHa$Vg2-*hX6>&i-C`mQ}7E z!t2M^=jK=XG784@;a#1J_Ju3&6^BZR3N6x&xw(-=vRSx~Bgh@sX3H`SN~yVO;ee}P z&1^Kb>PPP)5ntw8LZy~{<9ks*NYvnEW5=d zOWUEcw$rRo9sl+%#%GK8@;mh3Yg$9DWzi%0FF1a&dM$qd$kX-boRT^K4E+x>eEp61 z*hq0g=-VW;7Uzi4+|k?UUlnQYhA(z}7d__wA#h%IZ;tzVJV^zhPJue;?pbqMM@=Jk zNKWG-IzML*zbBG1X}|h>Kl`Hvo~`57QWyQfO$EU!8TuTdNvqReHL9z!0=VVB(9Aa; z?(IZ#wVN)-nw~f=qZeqw)Na?NrgA898)9S)P(~*bch&oszCgK%NDpeNhn>MYxm%b$ zVr71vtiX+m|2CV^a<86e`igs$;hBM-Fs4Z-T|%FJoSsEf1$wc&A36aAEf^7N2_3ykZC+qIv>HZl8#jHu%4YIvq(pxl22Gsi&@IH z5<9`qKF?l?JB$&+6)n1MwCkh{a-}UD3SEx7n_L{^htgNLs1k0u*9BI#ib>#zBLdc1 z+AO7}P-GFBux6Q5q4@)|5DYFeVp=JT%4|cA4bx^Zf`^U z((jgHq{`Bs7i(>uB9<_t>o28%_0#lE$+^NMXPcb$9YUtK(3J>S{-o|M{1@pT>5f{6 zwg)+19VDbAzte6J4|AbFTUzw3xr@=72Et*s$~V%NP^w)njh^j7vDRMCl%gwAAF#8p zK=K2xR-50dr1{;jm3-8qwe0jxb%+{84mp$91MAUl^RrBBG37e$CQK}mo1=kqzvm&} z6A!c6#M!N*{Bis0f@+z4@FIjkv2A zGfQWbzMP(*FsGXazc2mZS}a_AXg)lVBguO6$e5JhAZwa$|} z1_CB!JFs7|QsmMEua3xQhWsh*UoW;3)@DDk*?Ng^yVyUyU&S8E@E`O|yL($MWXAv> zDaMQmu5?73nsNlihEK}hZTP<$cbPEq*XOmM{h)fU-W*}dC7c~mBWA?^G=WiKewjZt z^G(q_EMJ#JY%F?Js9rL$Y?ArH7=wR-RaB8!%5Rm1W*z|Yk1n^gr)2fiExlg%y7`+X zM6Jd<{__($BFAjTEJa!qrPzAyaq+`oj&9YlEfQuyZANcWc0qO_ag(_q!qhjEj=(AW z@tqBz%+v4biwrSb2Q*ae{vg94zVFl5!I0@3cw}>FQQ%K|a*EdpShaC5nC=W!46@Wx zWJNvIRiB|Rm+B?lBGYzv0rFMp8is&Lx9um7Uyi5UCtfJJv_jUA*7?h#fzMO8Km0LL z@(Q|i`Ke4&|FP|s18SvK zl&Y;O)->JAFUMb`%I2UIPt={E-MTTBx3q9>#*4PjJxptfH~=^rMA~qG-NAU{qKpbL zD?zmjGKGyJQ?wiHL{6gVz~1F$2^Rcj9%^g1YnE6OWTg3DN-{FqKOZ zZBtX)8Y&UPcM*H{fwNnWWft-OZQUW#4vn6;WJ^A85g1~b)vg}FQd_y3Z1@b6i>Ko7 zp~37c=jaAq3FOInY+%$)F8E!Sd02gME8T?>$O|i-`&F?1r2lYpS^E6e&~S`lB<;^M zudJUYFO#7uUBhVwM8mqY|nj>p;VqJog{prnVcU)bYu)+kHitaP+UkC z*9(@p7L3fneBZO;;0R6q;Qf61z1YYjEuYQOo$V9YyAe@HH(AvnK{zLZtLj^P_DUxR z=@DF%rIFI@>68C5CjcAdng*TX*Ur%T{YC@*8wdpT03*5k6O<1l(h9F(YN;N&-A(ap zL2gUweP?1h*za>GFc{E+hU{5-?a(4Y1@k+8?exK^dixaW@3%YeD=&NWU9E1!g)7zb z)Kbg2M#I|gyM+C;-p&hPF~DD?B$rIIy|v!bFz4WFR!@N8lqMy1Z-0FR=-)>agxF0b z<8JT%_N4Pr<*pPvbDZZXC%;CK>UTPyS~KZM`)hN#d1nx$iTt^8!QR;oXq$=3Pq<^~ z@#%AxX?_5o7lrTVc8C7sO`MvC-blvPsO;^1a%hKYCcaB7IEaxlAmU3mv96xg5A?8O} zm40~3&GZqcndrIZ)Gw(yULZK4IJpuUk!@#^VMjFWhV$akZ-kA$u5?gvXLNn zk$=Srj7qbZN@&8$>M4z@D;R=qPY!STHO|osM?Hw_8hVYGl!=S#J^%!%>>L0#Wk2&# zFU?T|ey49Ro$Hd7}9mT7|QOR_h13=0ET=bI-p`5W3e1bmZ9RT(oi7!o4 zD&mKr2x2+H8omoyw9YG=LW$F?s_`s#T}L6zm5-3GLic$Qb47s|6y87c^y>e{{%ZY@ z1`!#bIRM0QB}7b-CqG=ADtxDR71eP72oW~%nQP)RA;>i9{{@Hh!&k)x|8}8Qto(C! z?^j{?zg7M%dAq*fyPzP{6ZB4r$-NE$V%jl%l(-hzS4SxNhbHRfRWN#)D{b$p+157DD<2ct*`9X3sC}}-t_~( zly(hEJOvBa#hRgJWQDzg-pK>N>-v4vp59NCpktWdyO8M5MO_RY+dBa8p6E91EV-Xe z8woGk^qfPL2vs)yh&41@H^{@irhTCgs$NX>!xVRExkxedYHq9RLX15Ta<=2{Lk$Bk~dcM0Htg8;b^ezhL?52LRV_mXGiis$0KizwGuG z!2v*c#b4|NgAy7Rn&D;Q(d#x6dk2;;*7aWK0buQXlh3}%Nr>1wmxuRzxhK~7kcH8S zZPXyHcUo*Qu>emlLbNV&g^GKBCyozk5bE*W5{1lZQI60;{Kutf3M}m9_s-M^9@+?* XoRnR@SmEw^9%L1DAQJPS9nk&{&^rEI literal 0 HcmV?d00001 diff --git a/WAClient/Base.ts b/WAClient/Base.ts new file mode 100644 index 0000000..8eabd4b --- /dev/null +++ b/WAClient/Base.ts @@ -0,0 +1,229 @@ +import WAConnection from '../WAConnection/WAConnection' +import { MessageStatus, MessageStatusUpdate, PresenceUpdate } from './Constants' +import { + WAMessage, + WANode, + WAMetric, + WAFlag, + WAGroupCreateResponse, + WAGroupMetadata, + WAGroupModification, +} from '../WAConnection/Constants' +import { generateMessageTag } from '../WAConnection/Utils' + +export default class WhatsAppWebBase extends WAConnection { + /** Set the callback for unexpected disconnects */ + setOnUnexpectedDisconnect(callback: (error: Error) => void) { + this.unexpectedDisconnect = (err) => { + this.close() + callback(err) + } + } + /** Set the callback for message status updates (when a message is delivered, read etc.) */ + setOnMessageStatusChange(callback: (update: MessageStatusUpdate) => void) { + const func = (json) => { + json = json[1] + let ids = json.id + if (json.cmd === 'ack') { + ids = [json.id] + } + const ackTypes = [MessageStatus.sent, MessageStatus.received, MessageStatus.read] + const data: MessageStatusUpdate = { + from: json.from, + to: json.to, + participant: json.participant, + timestamp: new Date(json.t * 1000), + ids: ids, + type: ackTypes[json.ack - 1] || 'unknown (' + json.ack + ')', + } + callback(data) + } + this.registerCallback('Msg', func) + this.registerCallback('MsgInfo', func) + } + /** + * Set the callback for new/unread messages; if someone sends you a message, this callback will be fired + * @param callbackOnMyMessages - should the callback be fired on a message you sent from the phone + */ + setOnUnreadMessage(callbackOnMyMessages = false, callback: (m: WAMessage) => void) { + this.registerCallback(['action', 'add:relay', 'message'], (json) => { + const message = json[2][0][2] + if (!message.key.fromMe || callbackOnMyMessages) { + // if this message was sent to us, notify + callback(message as WAMessage) + } else if (this.logUnhandledMessages) { + this.log(`[Unhandled] message - ${JSON.stringify(message)}`) + } + }) + } + /** Set the callback for presence updates; if someone goes offline/online, this callback will be fired */ + setOnPresenceUpdate(callback: (p: PresenceUpdate) => void) { + this.registerCallback('Presence', (json) => callback(json[1])) + } + /** Query whether a given number is registered on WhatsApp */ + isOnWhatsApp = (jid: string) => this.query(['query', 'exist', jid]).then((m) => m.status === 200) + /** Request an update on the presence of a user */ + requestPresenceUpdate = (jid: string) => this.queryExpecting200(['action', 'presence', 'subscribe', jid]) + /** Query the status of the person (see groupMetadata() for groups) */ + getStatus = (jid: string | null) => + this.query(['query', 'Status', jid || this.userMetaData.id]) as Promise<{ status: string }> + /** Get the URL to download the profile picture of a person/group */ + async getProfilePicture(jid: string | null) { + const response = await this.queryExpecting200(['query', 'ProfilePicThumb', jid || this.userMetaData.id]) + return response.eurl as string + } + /** Get your contacts */ + async getContacts() { + const json = ['query', { epoch: this.msgCount.toString(), type: 'contacts' }, null] + const response = await this.query(json, [WAMetric.group, WAFlag.ignore]) // this has to be an encrypted query + console.log(response) + return response + } + /** Fetch your chats */ + getChats() { + const json = ['query', { epoch: this.msgCount.toString(), type: 'chat' }, null] + return this.query(json, [WAMetric.group, WAFlag.ignore]) // this has to be an encrypted query + } + /** + * Check if your phone is connected + * @param timeoutMs max time for the phone to respond + */ + async isPhoneConnected(timeoutMs = 5000) { + try { + const response = await this.query(['admin', 'test'], null, timeoutMs) + return response[1] as boolean + } catch (error) { + return false + } + } + /** + * Load the conversation with a group or person + * @param count the number of messages to load + * @param [indexMessage] the data for which message to offset the query by + * @param [mostRecentFirst] retreive the most recent message first or retreive from the converation start + */ + async loadConversation( + jid: string, + count: number, + indexMessage: { id: string; fromMe: boolean } = null, + mostRecentFirst = true, + ) { + const json = [ + 'query', + { + epoch: this.msgCount.toString(), + type: 'message', + jid: jid, + kind: mostRecentFirst ? 'before' : 'after', + count: count.toString(), + index: indexMessage?.id, + owner: indexMessage?.fromMe === false ? 'false' : 'true', + }, + null, + ] + const response = await this.query(json, [WAMetric.group, WAFlag.ignore]) + + if (response.status) throw new Error(`error in query, got status: ${response.status}`) + + return response[2] ? (response[2] as WANode[]).map((item) => item[2] as WAMessage) : [] + } + /** + * Load the entire friggin conversation with a group or person + * @param onMessage callback for every message retreived + * @param [chunkSize] the number of messages to load in a single request + * @param [mostRecentFirst] retreive the most recent message first or retreive from the converation start + */ + loadEntireConversation(jid: string, onMessage: (m: WAMessage) => void, chunkSize = 25, mostRecentFirst = true) { + let offsetID = null + + const loadMessage = async () => { + const json = await this.loadConversation(jid, chunkSize, offsetID, mostRecentFirst) + // callback with most recent message first (descending order of date) + let lastMessage + if (mostRecentFirst) { + for (let i = json.length - 1; i >= 0; i--) { + onMessage(json[i]) + lastMessage = json[i] + } + } else { + for (let i = 0; i < json.length; i++) { + onMessage(json[i]) + lastMessage = json[i] + } + } + // if there are still more messages + if (json.length >= chunkSize) { + offsetID = lastMessage.key // get the last message + return new Promise((resolve, reject) => { + // send query after 200 ms + setTimeout(() => loadMessage().then(resolve).catch(reject), 200) + }) + } + } + return loadMessage() as Promise + } + /** Generic function for group queries */ + groupQuery(type: string, jid?: string, subject?: string, participants?: string[]) { + const json: WANode = [ + 'group', + { + author: this.userMetaData.id, + id: generateMessageTag(), + type: type, + jid: jid, + subject: subject, + }, + participants ? participants.map((str) => ['participant', { jid: str }, null]) : [], + ] + const q = ['action', { type: 'set', epoch: this.msgCount.toString() }, [json]] + return this.queryExpecting200(q, [WAMetric.group, WAFlag.ignore]) + } + /** Get the metadata of the group */ + groupMetadata = (jid: string) => this.queryExpecting200(['query', 'GroupMetadata', jid]) as Promise + /** + * Create a group + * @param title like, the title of the group + * @param participants people to include in the group + */ + groupCreate = (title: string, participants: string[]) => + this.groupQuery('create', null, title, participants) as Promise + /** + * Leave a group + * @param jid the ID of the group + */ + groupLeave = (jid: string) => this.groupQuery('leave', jid) as Promise<{ status: number }> + /** + * Update the subject of the group + * @param {string} jid the ID of the group + * @param {string} title the new title of the group + */ + groupUpdateSubject = (jid: string, title: string) => + this.groupQuery('subject', jid, title) as Promise<{ status: number }> + /** + * Add somebody to the group + * @param jid the ID of the group + * @param participants the people to add + */ + groupAdd = (jid: string, participants: string[]) => + this.groupQuery('add', jid, null, participants) as Promise + /** + * Remove somebody from the group + * @param jid the ID of the group + * @param participants the people to remove + */ + groupRemove = (jid: string, participants: string[]) => + this.groupQuery('remove', jid, null, participants) as Promise + /** + * Make someone admin on the group + * @param jid the ID of the group + * @param participants the people to make admin + */ + groupMakeAdmin = (jid: string, participants: string[]) => + this.groupQuery('promote', jid, null, participants) as Promise + /** Get the invite link of the given group */ + async groupInviteCode(jid: string) { + const json = ['query', 'inviteCode', jid] + const response = await this.queryExpecting200(json) + return response.code as string + } +} diff --git a/WAClient/Constants.ts b/WAClient/Constants.ts new file mode 100644 index 0000000..463b803 --- /dev/null +++ b/WAClient/Constants.ts @@ -0,0 +1,109 @@ +import { WAMessage } from '../WAConnection/Constants' +import { proto } from '../Binary/WAMessage' +/** + * set of statuses visible to other people; see updatePresence() in WhatsAppWeb.Send + */ +export enum Presence { + available = 'available', // "online" + unavailable = 'unavailable', // "offline" + composing = 'composing', // "typing..." + recording = 'recording', // "recording..." + paused = 'paused', // I have no clue +} +/** + * Status of a message sent or received + */ +export enum MessageStatus { + sent = 'sent', + received = 'received', + read = 'read', +} +/** + * set of message types that are supported by the library + */ +export enum MessageType { + text = 'conversation', + extendedText = 'extendedTextMessage', + contact = 'contactMessage', + location = 'locationMessage', + liveLocation = 'liveLocationMessage', + + image = 'imageMessage', + video = 'videoMessage', + sticker = 'stickerMessage', + document = 'documentMessage', + audio = 'audioMessage', +} +/** + * Tells us what kind of message it is + */ +export const MessageStubTypes = { + 20: 'addedToGroup', + 32: 'leftGroup', + 39: 'createdGroup', +} +export const HKDFInfoKeys = (function () { + const dict: Record = {} + dict[MessageType.image] = 'WhatsApp Image Keys' + dict[MessageType.video] = 'WhatsApp Audio Keys' + dict[MessageType.document] = 'WhatsApp Document Keys' + dict[MessageType.sticker] = 'WhatsApp Image Keys' + return dict +})() +export enum Mimetype { + jpeg = 'image/jpeg', + mp4 = 'video/mp4', + gif = 'video/gif', + pdf = 'appliction/pdf', + ogg = 'audio/ogg; codecs=opus', + /** for stickers */ + webp = 'image/webp', +} +export interface MessageOptions { + quoted?: WAMessage + timestamp?: Date + caption?: string + thumbnail?: string + mimetype?: Mimetype +} +export interface MessageStatusUpdate { + from: string + to: string + participant?: string + timestamp: Date + /** Message IDs read/delivered */ + ids: string[] + /** Status of the Message IDs */ + type: string +} +export interface PresenceUpdate { + id: string + type?: string + deny?: boolean +} +// path to upload the media +export const MediaPathMap = { + imageMessage: '/mms/image', + videoMessage: '/mms/video', + documentMessage: '/mms/document', + audioMessage: '/mms/audio', + stickerMessage: '/mms/image', +} +// gives WhatsApp info to process the media +export const MimetypeMap = { + imageMessage: Mimetype.jpeg, + videoMessage: Mimetype.mp4, + documentMessage: Mimetype.pdf, + audioMessage: Mimetype.ogg, + stickerMessage: Mimetype.webp, +} +export interface WASendMessageResponse { + status: number + messageID: string +} +export interface WALocationMessage { + degreesLatitude: number + degreesLongitude: number + address?: string +} +export type WAContactMessage = proto.ContactMessage diff --git a/WAClient/Messages.ts b/WAClient/Messages.ts new file mode 100644 index 0000000..dd3e42d --- /dev/null +++ b/WAClient/Messages.ts @@ -0,0 +1,172 @@ +import WhatsAppWebBase from './Base' +import fetch from 'node-fetch' +import { + MessageOptions, + MessageType, + Mimetype, + MimetypeMap, + MediaPathMap, + WALocationMessage, + WAContactMessage, + WASendMessageResponse, + Presence, +} from './Constants' +import { generateMessageID, sha256, hmacSign, aesEncrypWithIV, randomBytes } from '../WAConnection/Utils' +import { WAMessageContent, WAMetric, WAFlag } from '../WAConnection/Constants' +import { generateThumbnail, getMediaKeys } from './Utils' + +export default class WhatsAppWebMessages extends WhatsAppWebBase { + /** + * Send a read receipt to the given ID for a certain message + * @param {string} jid the ID of the person/group whose message you want to mark read + * @param {string} messageID the message ID + */ + sendReadReceipt(jid: string, messageID: string) { + const json = [ + 'action', + { epoch: this.msgCount.toString(), type: 'set' }, + [['read', { count: '1', index: messageID, jid: jid, owner: 'false' }, null]], + ] + return this.queryExpecting200(json, [WAMetric.group, WAFlag.ignore]) // encrypt and send off + } + /** + * Tell someone about your presence -- online, typing, offline etc. + * @param jid the ID of the person/group who you are updating + * @param type your presence + */ + async updatePresence(jid: string, type: Presence) { + const json = [ + 'action', + { epoch: this.msgCount.toString(), type: 'set' }, + [['presence', { type: type, to: jid }, null]], + ] + return this.queryExpecting200(json, [WAMetric.group, WAFlag.acknowledge]) as Promise<{ status: number }> + } + async sendMessage( + id: string, + message: string | WALocationMessage | WAContactMessage | Buffer, + type: MessageType, + options: MessageOptions = {}, + ) { + let m: any = {} + switch (type) { + case MessageType.text: + case MessageType.extendedText: + if (typeof message !== 'string') { + throw 'expected message to be a string' + } + m.extendedTextMessage = { text: message } + break + case MessageType.location: + case MessageType.liveLocation: + m.locationMessage = message as WALocationMessage + break + case MessageType.contact: + m.contactMessage = message as WAContactMessage + break + default: + m = await this.prepareMediaMessage(message as Buffer, type, options) + break + } + return this.sendGenericMessage(id, m as WAMessageContent, options) + } + /** Prepare a media message for sending */ + protected async prepareMediaMessage(buffer: Buffer, mediaType: MessageType, options: MessageOptions = {}) { + if (mediaType === MessageType.document && !options.mimetype) { + throw 'mimetype required to send a document' + } + if (mediaType === MessageType.sticker && options.caption) { + throw 'cannot send a caption with a sticker' + } + if (!options.mimetype) { + options.mimetype = MimetypeMap[mediaType] + } + let isGIF = false + if (options.mimetype === Mimetype.gif) { + isGIF = true + options.mimetype = MimetypeMap[MessageType.video] + } + // generate a media key + const mediaKey = randomBytes(32) + const mediaKeys = getMediaKeys(mediaKey, mediaType) + const enc = aesEncrypWithIV(buffer, mediaKeys.cipherKey, mediaKeys.iv) + const mac = hmacSign(Buffer.concat([mediaKeys.iv, enc]), mediaKeys.macKey).slice(0, 10) + const body = Buffer.concat([enc, mac]) // body is enc + mac + const fileSha256 = sha256(buffer) + // url safe Base64 encode the SHA256 hash of the body + const fileEncSha256B64 = sha256(body) + .toString('base64') + .replace(/\+/g, '-') + .replace(/\//g, '_') + .replace(/\=+$/, '') + + await generateThumbnail(buffer, mediaType, options) + // send a query JSON to obtain the url & auth token to upload our media + const json = (await this.query(['query', 'mediaConn'])).media_conn + const auth = json.auth // the auth token + let hostname = 'https://' + json.hosts[0].hostname // first hostname available + hostname += MediaPathMap[mediaType] + '/' + fileEncSha256B64 // append path + hostname += '?auth=' + auth // add auth token + hostname += '&token=' + fileEncSha256B64 // file hash + + const urlFetch = await fetch(hostname, { + method: 'POST', + body: body, + headers: { Origin: 'https://web.whatsapp.com' }, + }) + const responseJSON = await urlFetch.json() + if (!responseJSON.url) { + throw 'UPLOAD FAILED GOT: ' + JSON.stringify(responseJSON) + } + const message = {} + message[mediaType] = { + url: responseJSON.url, + mediaKey: mediaKey.toString('base64'), + mimetype: options.mimetype, + fileEncSha256: fileEncSha256B64, + fileSha256: fileSha256.toString('base64'), + fileLength: buffer.length, + gifPlayback: isGIF || null, + } + return message + } + /** Generic send message function */ + async sendGenericMessage(id: string, message: WAMessageContent, options: MessageOptions) { + if (!options.timestamp) { + // if no timestamp was provided, + options.timestamp = new Date() // set timestamp to now + } + const key = Object.keys(message)[0] + const timestamp = options.timestamp.getTime() / 1000 + const quoted = options.quoted + if (quoted) { + const participant = quoted.key.participant || quoted.key.remoteJid + message[key].contextInfo = { + participant: participant, + stanzaId: quoted.key.id, + quotedMessage: quoted.message, + } + // if a participant is quoted, then it must be a group + // hence, remoteJid of group must also be entered + if (quoted.key.participant) { + message[key].contextInfo.remoteJid = quoted.key.remoteJid + } + } + message[key].caption = options?.caption + message[key].jpegThumbnail = options?.thumbnail + + const messageJSON = { + key: { + remoteJid: id, + fromMe: true, + id: generateMessageID(), + }, + message: message, + messageTimestamp: timestamp, + participant: id.includes('@g.us') ? this.userMetaData.id : null, + } + const json = ['action', { epoch: this.msgCount.toString(), type: 'relay' }, [['message', null, messageJSON]]] + const response = await this.queryExpecting200(json, [WAMetric.message, WAFlag.ignore], null, messageJSON.key.id) + return { status: response.status as number, messageID: messageJSON.key.id } as WASendMessageResponse + } +} diff --git a/WAClient/Tests.ts b/WAClient/Tests.ts new file mode 100644 index 0000000..51dfa06 --- /dev/null +++ b/WAClient/Tests.ts @@ -0,0 +1,152 @@ +import { WAClient } from './WAClient' +import { MessageType, MessageOptions, Mimetype, Presence } from './Constants' +import fs from 'fs' + +import assert from 'assert' +import { decodeMediaMessage } from './Utils' +import { promiseTimeout } from '../WAConnection/Utils' + +const testJid = '919646328797@s.whatsapp.net' +const createTimeout = (timeout) => new Promise((resolve) => setTimeout(resolve, timeout)) + +async function sendAndRetreiveMessage(client: WAClient, content, type: MessageType, options: MessageOptions = {}) { + const response = await client.sendMessage(testJid, content, type, options) + assert.equal(response.status, 200) + const messages = await client.loadConversation(testJid, 1, null, true) + assert.equal(messages[0].key.id, response.messageID) + return messages[0] +} +function WAClientTest(name: string, func: (client: WAClient) => void) { + describe(name, () => { + const client = new WAClient() + before(async () => { + const file = './auth_info.json' + await client.connectSlim(file) + fs.writeFileSync(file, JSON.stringify(client.base64EncodedAuthInfo(), null, '\t')) + }) + after(() => client.close()) + func(client) + }) +} +WAClientTest('Messages', (client) => { + it('should send a text message', async () => { + const message = await sendAndRetreiveMessage(client, 'hello fren', MessageType.text) + assert.equal(message.message.conversation, 'hello fren') + }) + it('should quote a message', async () => { + const messages = await client.loadConversation(testJid, 2) + const message = await sendAndRetreiveMessage(client, 'hello fren 2', MessageType.extendedText, { + quoted: messages[0], + }) + assert.equal(message.message.extendedTextMessage.contextInfo.stanzaId, messages[0].key.id) + }) + it('should send a gif', async () => { + const content = fs.readFileSync('./Media/ma_gif.mp4') + const message = await sendAndRetreiveMessage(client, content, MessageType.video, { mimetype: Mimetype.gif }) + const file = await decodeMediaMessage(message.message, './Media/received_vid') + }) + it('should send an image', async () => { + const content = fs.readFileSync('./Media/meme.jpeg') + const message = await sendAndRetreiveMessage(client, content, MessageType.image) + const file = await decodeMediaMessage(message.message, './Media/received_img') + //const message2 = await sendAndRetreiveMessage (client, 'this is a quote', MessageType.extendedText) + }) + it('should send an image & quote', async () => { + const messages = await client.loadConversation(testJid, 1) + const content = fs.readFileSync('./Media/meme.jpeg') + const message = await sendAndRetreiveMessage(client, content, MessageType.image, { quoted: messages[0] }) + const file = await decodeMediaMessage(message.message, './Media/received_img') + assert.equal(message.message.imageMessage.contextInfo.stanzaId, messages[0].key.id) + }) +}) +WAClientTest('Presence', (client) => { + it('should update presence', async () => { + const presences = Object.values(Presence) + for (const i in presences) { + const response = await client.updatePresence(testJid, presences[i]) + assert.equal(response.status, 200) + + await createTimeout(1500) + } + }) +}) +WAClientTest('Misc', (client) => { + it('should tell if someone has an account on WhatsApp', async () => { + const response = await client.isOnWhatsApp(testJid) + assert.equal(response, true) + + const responseFail = await client.isOnWhatsApp('abcd@s.whatsapp.net') + assert.equal(responseFail, false) + }) + it('should return the status', async () => { + const response = await client.getStatus(testJid) + assert.ok(response.status) + assert.equal(typeof response.status, 'string') + }) + it('should return the profile picture', async () => { + const response = await client.getProfilePicture(testJid) + assert.ok(response) + assert.rejects(client.getProfilePicture('abcd@s.whatsapp.net')) + }) +}) +WAClientTest('Groups', (client) => { + let gid: string + it('should create a group', async () => { + const response = await client.groupCreate('Cool Test Group', [testJid]) + assert.equal(response.status, 200) + gid = response.gid + console.log('created group: ' + gid) + }) + it('should retreive group invite code', async () => { + const code = await client.groupInviteCode(gid) + assert.ok(code) + assert.equal(typeof code, 'string') + }) + it('should retreive group metadata', async () => { + const metadata = await client.groupMetadata(gid) + assert.equal(metadata.id, gid) + assert.equal(metadata.participants.filter((obj) => obj.id.split('@')[0] === testJid.split('@')[0]).length, 1) + }) + it('should send a message on the group', async () => { + const r = await client.sendMessage(gid, 'hello', MessageType.text) + assert.equal(r.status, 200) + }) + it('should update the subject', async () => { + const subject = 'V Cool Title' + const r = await client.groupUpdateSubject(gid, subject) + assert.equal(r.status, 200) + + const metadata = await client.groupMetadata(gid) + assert.equal(metadata.subject, subject) + }) + it('should remove someone from a group', async () => { + await client.groupRemove(gid, [testJid]) + }) + it('should leave the group', async () => { + const response = await client.groupLeave(gid) + assert.equal(response.status, 200) + }) +}) +WAClientTest('Events', (client) => { + it('should deliver a message', async () => { + const waitForUpdate = () => + new Promise((resolve) => { + client.setOnMessageStatusChange((update) => { + if (update.ids.includes(response.messageID)) { + resolve() + } + }) + }) + const response = await client.sendMessage(testJid, 'My Name Jeff', MessageType.text) + await promiseTimeout(10000, waitForUpdate()) + }) + /* it ('should update me on presence', async () => { + //client.logUnhandledMessages = true + client.setOnPresenceUpdate (presence => { + console.log (presence) + }) + const response = await client.requestPresenceUpdate (client.userMetaData) + assert.equal (response.status, 200) + await createTimeout (25000) + })*/ +}) diff --git a/WAClient/Utils.ts b/WAClient/Utils.ts new file mode 100644 index 0000000..9dc6d1d --- /dev/null +++ b/WAClient/Utils.ts @@ -0,0 +1,132 @@ +import { MessageType, HKDFInfoKeys, MessageOptions, MessageStubTypes } from './Constants' +import sharp from 'sharp' +import fs from 'fs' +import fetch from 'node-fetch' +import { WAMessage, WAMessageContent } from '../WAConnection/Constants' +import { hmacSign, aesDecryptWithIV, hkdf } from '../WAConnection/Utils' +import { proto } from '../Binary/WAMessage' +import { randomBytes } from 'crypto' +import { exec } from 'child_process' + +/** Type of notification */ +export function getNotificationType(message: WAMessage) { + if (message.message) { + return ['message', Object.keys(message.message)[0]] + } else if (message.messageStubType) { + return [MessageStubTypes[message.messageStubType], null] + } else { + return ['unknown', null] + } +} +/** generates all the keys required to encrypt/decrypt & sign a media message */ + +export function getMediaKeys(buffer, mediaType: MessageType) { + // expand using HKDF to 112 bytes, also pass in the relevant app info + const expandedMediaKey = hkdf(buffer, 112, HKDFInfoKeys[mediaType]) + return { + iv: expandedMediaKey.slice(0, 16), + cipherKey: expandedMediaKey.slice(16, 48), + macKey: expandedMediaKey.slice(48, 80), + } +} +/** Extracts video thumb using FFMPEG */ +const extractVideoThumb = async ( + path: string, + destPath: string, + time: string, + size: { width: number; height: number }, +) => + new Promise((resolve, reject) => { + const cmd = `ffmpeg -ss ${time} -i ${path} -y -s ${size.width}x${size.height} -vframes 1 -f image2 ${destPath}` + exec(cmd, (err) => { + if (err) { + reject(err) + } else { + resolve() + } + }) + }) as Promise + +/** generates a thumbnail for a given media, if required */ + +export async function generateThumbnail(buffer: Buffer, mediaType: MessageType, info: MessageOptions) { + if (info.thumbnail === null || info.thumbnail) { + // don't do anything if the thumbnail is already provided, or is null + if (mediaType === MessageType.audio) { + throw 'audio messages cannot have thumbnails' + } + } else if (mediaType === MessageType.image || mediaType === MessageType.sticker) { + const buff = await sharp(buffer).resize(48, 48).jpeg().toBuffer() + info.thumbnail = buff.toString('base64') + } else if (mediaType === MessageType.video) { + const filename = './' + randomBytes(5).toString('hex') + '.mp4' + const imgFilename = filename + '.jpg' + fs.writeFileSync(filename, buffer) + try { + await extractVideoThumb(filename, imgFilename, '00:00:00', { width: 48, height: 48 }) + const buff = fs.readFileSync(imgFilename) + info.thumbnail = buff.toString('base64') + fs.unlinkSync(imgFilename) + } catch (err) { + console.log('could not generate video thumb: ' + err) + } + fs.unlinkSync(filename) + } +} +/** + * Decode a media message (video, image, document, audio) & save it to the given file + * @param message the media message you want to decode + * @param filename the name of the file where the media will be saved + */ +export async function decodeMediaMessage(message: WAMessageContent, filename: string) { + const getExtension = (mimetype) => mimetype.split(';')[0].split('/')[1] + /* + One can infer media type from the key in the message + it is usually written as [mediaType]Message. Eg. imageMessage, audioMessage etc. + */ + const type = Object.keys(message)[0] as MessageType + if (!type) { + throw 'unknown message type' + } + if (type === MessageType.text || type === MessageType.extendedText) { + throw 'cannot decode text message' + } + if (type === MessageType.location || type === MessageType.liveLocation) { + fs.writeFileSync(filename + '.jpeg', message[type].jpegThumbnail) + return { filename: filename + '.jpeg' } + } + + const messageContent = message[type] as + | proto.VideoMessage + | proto.ImageMessage + | proto.AudioMessage + | proto.DocumentMessage + // get the keys to decrypt the message + const mediaKeys = getMediaKeys(messageContent.mediaKey, type) //getMediaKeys(Buffer.from(messageContent.mediaKey, 'base64'), type) + const iv = mediaKeys.iv + const cipherKey = mediaKeys.cipherKey + const macKey = mediaKeys.macKey + + // download the message + const fetched = await fetch(messageContent.url, {}) + const buffer = await fetched.buffer() + // first part is actual file + const file = buffer.slice(0, buffer.length - 10) + // last 10 bytes is HMAC sign of file + const mac = buffer.slice(buffer.length - 10, buffer.length) + + // sign IV+file & check for match with mac + const testBuff = Buffer.concat([iv, file]) + const sign = hmacSign(testBuff, macKey).slice(0, 10) + // our sign should equal the mac + if (sign.equals(mac)) { + const decrypted = aesDecryptWithIV(file, cipherKey, iv) // decrypt media + + const trueFileName = filename + '.' + getExtension(messageContent.mimetype) + fs.writeFileSync(trueFileName, decrypted) + + return trueFileName + } else { + throw 'HMAC sign does not match' + } +} diff --git a/WAClient/WAClient.ts b/WAClient/WAClient.ts new file mode 100644 index 0000000..9548e78 --- /dev/null +++ b/WAClient/WAClient.ts @@ -0,0 +1,6 @@ +import WhatsAppWebMessages from './Messages' + +export { WhatsAppWebMessages as WAClient } +export * from './Constants' +export * from './Utils' +export * from '../WAConnection/Constants' diff --git a/WAConnection/Base.ts b/WAConnection/Base.ts new file mode 100644 index 0000000..5a70c3e --- /dev/null +++ b/WAConnection/Base.ts @@ -0,0 +1,264 @@ +import WS from 'ws' +import QR from 'qrcode-terminal' +import fs from 'fs' +import * as Utils from './Utils' +import Encoder from '../Binary/Encoder' +import Decoder from '../Binary/Decoder' +import { AuthenticationCredentials, UserMetaData, WANode, AuthenticationCredentialsBase64, WATag } from './Constants' + +/** Generate a QR code from the ref & the curve public key. This is scanned by the phone */ +const generateQRCode = function ([ref, publicKey, clientID]) { + const str = ref + ',' + publicKey + ',' + clientID + QR.generate(str, { small: true }) +} + +export default class WAConnectionBase { + /** The version of WhatsApp Web we're telling the servers we are */ + version: [number, number, number] = [2, 2025, 6] + /** The Browser we're telling the WhatsApp Web servers we are */ + browserDescription: [string, string] = ['Baileys', 'Baileys'] + /** Metadata like WhatsApp id, name set on WhatsApp etc. */ + userMetaData: UserMetaData = { id: null, name: null, phone: null } + /** Should reconnect automatically after an unexpected disconnect */ + autoReconnect = true + lastSeen: Date = null + /** Log messages that are not handled, so you can debug & see what custom stuff you can implement */ + logUnhandledMessages = false + /** Data structure of tokens & IDs used to establish one's identiy to WhatsApp Web */ + protected authInfo: AuthenticationCredentials = { + clientID: null, + serverToken: null, + clientToken: null, + encKey: null, + macKey: null, + } + /** Curve keys to initially authenticate */ + protected curveKeys: { private: Uint8Array; public: Uint8Array } + /** The websocket connection */ + protected conn: WS = null + protected msgCount = 0 + protected keepAliveReq: NodeJS.Timeout + protected callbacks = {} + protected encoder = new Encoder() + protected decoder = new Decoder() + /** + * What to do when you need the phone to authenticate the connection (generate QR code by default) + */ + onReadyForPhoneAuthentication = generateQRCode + unexpectedDisconnect = (err) => this.close() + /** + * base 64 encode the authentication credentials and return them + * these can then be used to login again by passing the object to the connect () function. + * @see connect () in WhatsAppWeb.Session + */ + base64EncodedAuthInfo() { + return { + clientID: this.authInfo.clientID, + serverToken: this.authInfo.serverToken, + clientToken: this.authInfo.clientToken, + encKey: this.authInfo.encKey.toString('base64'), + macKey: this.authInfo.macKey.toString('base64'), + } + } + /** + * Load in the authentication credentials + * @param authInfo the authentication credentials or path to auth credentials JSON + */ + loadAuthInfoFromBase64(authInfo: AuthenticationCredentialsBase64 | string) { + if (!authInfo) { + throw 'given authInfo is null' + } + if (typeof authInfo === 'string') { + this.log(`loading authentication credentials from ${authInfo}`) + const file = fs.readFileSync(authInfo, { encoding: 'utf-8' }) // load a closed session back if it exists + authInfo = JSON.parse(file) as AuthenticationCredentialsBase64 + } + this.authInfo = { + clientID: authInfo.clientID, + serverToken: authInfo.serverToken, + clientToken: authInfo.clientToken, + encKey: Buffer.from(authInfo.encKey, 'base64'), // decode from base64 + macKey: Buffer.from(authInfo.macKey, 'base64'), // decode from base64 + } + } + /** + * Register for a callback for a certain function, will cancel automatically after one execution + * @param {[string, object, string] | string} parameters name of the function along with some optional specific parameters + */ + async registerCallbackOneTime(parameters) { + const json = await new Promise((resolve, _) => this.registerCallback(parameters, resolve)) + this.deregisterCallback(parameters) + return json + } + /** + * Register for a callback for a certain function + * @param parameters name of the function along with some optional specific parameters + */ + registerCallback(parameters: [string, string?, string?] | string, callback) { + if (typeof parameters === 'string') { + return this.registerCallback([parameters, null, null], callback) + } + if (!Array.isArray(parameters)) { + throw 'parameters (' + parameters + ') must be a string or array' + } + const func = 'function:' + parameters[0] + const key = parameters[1] || '' + const key2 = parameters[2] || '' + if (!this.callbacks[func]) { + this.callbacks[func] = {} + } + if (!this.callbacks[func][key]) { + this.callbacks[func][key] = {} + } + this.callbacks[func][key][key2] = callback + } + /** + * Cancel all further callback events associated with the given parameters + * @param parameters name of the function along with some optional specific parameters + */ + deregisterCallback(parameters: [string, string?, string?] | string) { + if (typeof parameters === 'string') { + return this.deregisterCallback([parameters]) + } + if (!Array.isArray(parameters)) { + throw 'parameters (' + parameters + ') must be a string or array' + } + const func = 'function:' + parameters[0] + const key = parameters[1] || '' + const key2 = parameters[2] || '' + if (this.callbacks[func] && this.callbacks[func][key] && this.callbacks[func][key][key2]) { + delete this.callbacks[func][key][key2] + return + } + this.log('WARNING: could not find ' + JSON.stringify(parameters) + ' to deregister') + } + /** + * Wait for a message with a certain tag to be received + * @param tag the message tag to await + * @param json query that was sent + * @param timeoutMs timeout after which the promise will reject + */ + async waitForMessage(tag: string, json: Object = null, timeoutMs: number = null) { + let promise = new Promise( + (resolve, reject) => (this.callbacks[tag] = { queryJSON: json, callback: resolve, errCallback: reject }), + ) + if (timeoutMs) { + promise = Utils.promiseTimeout(timeoutMs, promise).catch((err) => { + delete this.callbacks[tag] + throw err + }) + } + return promise as Promise + } + /** + * Query something from the WhatsApp servers and error on a non-200 status + * @param json the query itself + * @param [binaryTags] the tags to attach if the query is supposed to be sent encoded in binary + * @param [timeoutMs] timeout after which the query will be failed (set to null to disable a timeout) + * @param [tag] the tag to attach to the message + * recieved JSON + */ + async queryExpecting200( + json: any[] | WANode, + binaryTags: WATag = null, + timeoutMs: number = null, + tag: string = null, + ) { + return Utils.errorOnNon200Status(this.query(json, binaryTags, timeoutMs, tag)) + } + /** + * Query something from the WhatsApp servers + * @param json the query itself + * @param [binaryTags] the tags to attach if the query is supposed to be sent encoded in binary + * @param [timeoutMs] timeout after which the query will be failed (set to null to disable a timeout) + * @param [tag] the tag to attach to the message + * recieved JSON + */ + async query(json: any[] | WANode, binaryTags: WATag = null, timeoutMs: number = null, tag: string = null) { + if (binaryTags) { + tag = this.sendBinary(json as WANode, binaryTags, tag) + } else { + tag = this.sendJSON(json, tag) + } + return this.waitForMessage(tag, json, timeoutMs) + } + /** + * Send a binary encoded message + * @param json the message to encode & send + * @param {[number, number]} tags the binary tags to tell WhatsApp what the message is all about + * @param {string} [tag] the tag to attach to the message + * @return {string} the message tag + */ + private sendBinary(json: WANode, tags: [number, number], tag: string) { + const binary = this.encoder.write(json) // encode the JSON to the WhatsApp binary format + + let buff = Utils.aesEncrypt(binary, this.authInfo.encKey) // encrypt it using AES and our encKey + const sign = Utils.hmacSign(buff, this.authInfo.macKey) // sign the message using HMAC and our macKey + tag = tag || Utils.generateMessageTag() + buff = Buffer.concat([ + Buffer.from(tag + ','), // generate & prefix the message tag + Buffer.from(tags), // prefix some bytes that tell whatsapp what the message is about + sign, // the HMAC sign of the message + buff, // the actual encrypted buffer + ]) + this.send(buff) // send it off + return tag + } + /** + * Send a plain JSON message to the WhatsApp servers + * @private + * @param json the message to send + * @param [tag] the tag to attach to the message + * @return the message tag + */ + private sendJSON(json: any[] | WANode, tag: string = null) { + tag = tag || Utils.generateMessageTag() + this.send(tag + ',' + JSON.stringify(json)) + return tag + } + /** Send some message to the WhatsApp servers */ + protected send(m) { + if (!this.conn) { + throw 'cannot send message, disconnected from WhatsApp' + } + this.msgCount += 1 // increment message count, it makes the 'epoch' field when sending binary messages + this.conn.send(m) + } + /** + * Disconnect from the phone. Your auth credentials become invalid after sending a disconnect request. + * @see close() if you just want to close the connection + */ + async logout() { + if (!this.conn) { + throw "You're not even connected, you can't log out" + } + await new Promise((resolve) => { + this.conn.send('goodbye,["admin","Conn","disconnect"]', null, () => { + this.authInfo = null + resolve() + }) + }) + this.close() + } + /** Close the connection to WhatsApp Web */ + close() { + this.msgCount = 0 + if (this.conn) { + this.conn.close() + this.conn = null + } + const keys = Object.keys(this.callbacks) + keys.forEach((key) => { + if (!key.includes('function:')) { + this.callbacks[key].errCallback('connection closed') + delete this.callbacks[key] + } + }) + if (this.keepAliveReq) { + clearInterval(this.keepAliveReq) + } + } + protected log(text) { + console.log(`[Baileys] ${text}`) + } +} diff --git a/WAConnection/Connect.ts b/WAConnection/Connect.ts new file mode 100644 index 0000000..031779a --- /dev/null +++ b/WAConnection/Connect.ts @@ -0,0 +1,248 @@ +import WS from 'ws' + +import * as Utils from './Utils' +import { AuthenticationCredentialsBase64, UserMetaData, WAMessage, WAChat, WAContact } from './Constants' +import WAConnectionValidator from './Validation' + +export default class WAConnectionConnector extends WAConnectionValidator { + /** + * Connect to WhatsAppWeb + * @param [authInfo] credentials or path to credentials to log back in + * @param [timeoutMs] timeout after which the connect will fail, set to null for an infinite timeout + * @return returns [userMetaData, chats, contacts, unreadMessages] + */ + async connect(authInfo: AuthenticationCredentialsBase64 | string = null, timeoutMs: number = null) { + const userInfo = await this.connectSlim(authInfo, timeoutMs) + const chats = await this.receiveChatsAndContacts() + return [userInfo, ...chats] as [UserMetaData, WAChat[], WAContact[], WAMessage[]] + } + /** + * Connect to WhatsAppWeb, resolves without waiting for chats & contacts + * @param [authInfo] credentials to log back in + * @param [timeoutMs] timeout after which the connect will fail, set to null for an infinite timeout + * @return [userMetaData, chats, contacts, unreadMessages] + */ + async connectSlim(authInfo: AuthenticationCredentialsBase64 | string = null, timeoutMs: number = null) { + // if we're already connected, throw an error + if (this.conn) { + throw [1, 'already connected or connecting'] + } + // set authentication credentials if required + try { + this.loadAuthInfoFromBase64(authInfo) + } catch {} + + this.conn = new WS('wss://web.whatsapp.com/ws', null, { origin: 'https://web.whatsapp.com' }) + + let promise: Promise = new Promise((resolve, reject) => { + this.conn.on('open', () => { + this.log('connected to WhatsApp Web, authenticating...') + // start sending keep alive requests (keeps the WebSocket alive & updates our last seen) + this.authenticate() + .then((user) => { + this.startKeepAliveRequest() + resolve(user) + }) + .catch(reject) + }) + this.conn.on('message', (m) => this.onMessageRecieved(m)) // in WhatsAppWeb.Recv.js + this.conn.on('error', (error) => { + // if there was an error in the WebSocket + this.close() + reject(error) + }) + }) + promise = timeoutMs ? Utils.promiseTimeout(timeoutMs, promise) : promise + return promise.catch((err) => { + this.close() + throw err + }) + } + /** + * Sets up callbacks to receive chats, contacts & unread messages. + * Must be called immediately after connect + * [chats, contacts, unreadMessages] + */ + receiveChatsAndContacts() { + const chats: Array = [] + let contacts: Array = [] + const unreadMessages: Array = [] + const unreadMap = {} + + let encounteredAddBefore = false + let convoResolve + + this.log('waiting for chats & contacts') // wait for the message with chats + const waitForConvos = () => + new Promise((resolve, _) => { + convoResolve = resolve + const chatUpdate = (json) => { + const isLast = json[1].last + encounteredAddBefore = json[1].add === 'before' ? true : encounteredAddBefore + + json = json[2] + if (json) { + for (let k = json.length - 1; k >= 0; k--) { + const message = json[k][2] + const jid = message.key.remoteJid.replace('@s.whatsapp.net', '@c.us') + if (!message.key.fromMe && unreadMap[jid] > 0) { + // only forward if the message is from the sender + unreadMessages.push(message) + unreadMap[jid] -= 1 // reduce + } + } + } + if (isLast) { + // de-register the callbacks, so that they don't get called again + this.deregisterCallback(['action', 'add:last']) + this.deregisterCallback(['action', 'add:before']) + this.deregisterCallback(['action', 'add:unread']) + resolve() + } + } + // wait for actual messages to load, "last" is the most recent message, "before" contains prior messages + this.registerCallback(['action', 'add:last'], chatUpdate) + this.registerCallback(['action', 'add:before'], chatUpdate) + this.registerCallback(['action', 'add:unread'], chatUpdate) + }) + const waitForChats = this.registerCallbackOneTime(['response', 'type:chat']).then((json) => { + json[2].forEach((chat) => { + chats.push(chat[1]) // chats data (log json to see what it looks like) + // store the number of unread messages for each sender + unreadMap[chat[1].jid] = chat[1].count + }) + if (chats && chats.length > 0) return waitForConvos() + }) + const waitForContacts = this.registerCallbackOneTime(['response', 'type:contacts']).then((json) => { + contacts = json[2].map((item) => item[1]) + // if no add:before messages are sent, and you receive contacts + // should probably resolve the promise + if (!encounteredAddBefore && convoResolve) convoResolve() + }) + // wait for the chats & contacts to load + return Promise.all([waitForChats, waitForContacts]).then(() => [chats, contacts, unreadMessages]) + } + private onMessageRecieved(message) { + if (message[0] === '!') { + // when the first character in the message is an '!', the server is updating the last seen + const timestamp = message.slice(1, message.length) + this.lastSeen = new Date(parseInt(timestamp)) + } else { + const commaIndex = message.indexOf(',') // all whatsapp messages have a tag and a comma, followed by the actual message + + if (commaIndex < 0) { + // if there was no comma, then this message must be not be valid + throw [2, 'invalid message', message] + } + + let data = message.slice(commaIndex + 1, message.length) + // get the message tag. + // If a query was done, the server will respond with the same message tag we sent the query with + const messageTag = message.slice(0, commaIndex).toString() + if (data.length === 0) { + // got an empty message, usually get one after sending a query with the 128 tag + return + } + + let json + if (data[0] === '[' || data[0] === '{') { + // if the first character is a "[", then the data must just be plain JSON array or object + json = JSON.parse(data) // parse the JSON + } else if (this.authInfo.macKey && this.authInfo.encKey) { + /* + If the data recieved was not a JSON, then it must be an encrypted message. + Such a message can only be decrypted if we're connected successfully to the servers & have encryption keys + */ + + const checksum = data.slice(0, 32) // the first 32 bytes of the buffer are the HMAC sign of the message + data = data.slice(32, data.length) // the actual message + + const computedChecksum = Utils.hmacSign(data, this.authInfo.macKey) // compute the sign of the message we recieved using our macKey + + if (checksum.equals(computedChecksum)) { + // the checksum the server sent, must match the one we computed for the message to be valid + const decrypted = Utils.aesDecrypt(data, this.authInfo.encKey) // decrypt using AES + json = this.decoder.read(decrypted) // decode the binary message into a JSON array + } else { + throw [7, "checksums don't match"] + } + } else { + // if we recieved a message that was encrypted but we don't have the keys, then there must be an error + throw [3, 'recieved encrypted message when auth creds not available', message] + } + /* + Check if this is a response to a message we sent + */ + if (this.callbacks[messageTag]) { + const q = this.callbacks[messageTag] + q.callback(json) + delete this.callbacks[messageTag] + return + } + /* + Check if this is a response to a message we are expecting + */ + if (this.callbacks['function:' + json[0]]) { + const callbacks = this.callbacks['function:' + json[0]] + let callbacks2 + let callback + for (const key in json[1] || {}) { + callbacks2 = callbacks[key + ':' + json[1][key]] + if (callbacks2) { + break + } + } + if (!callbacks2) { + for (const key in json[1] || {}) { + callbacks2 = callbacks[key] + if (callbacks2) { + break + } + } + } + if (!callbacks2) { + callbacks2 = callbacks[''] + } + if (callbacks2) { + callback = callbacks2[json[2] && json[2][0][0]] + if (!callback) { + callback = callbacks2[''] + } + } + if (callback) { + callback(json) + return + } + } + if (this.logUnhandledMessages) { + this.log('[Unhandled] ' + messageTag + ', ' + JSON.stringify(json)) + } + } + } + /** Send a keep alive request every X seconds, server updates & responds with last seen */ + private startKeepAliveRequest() { + const refreshInterval = 20 + this.keepAliveReq = setInterval(() => { + const diff = (new Date().getTime() - this.lastSeen.getTime()) / 1000 + /* + check if it's been a suspicious amount of time since the server responded with our last seen + it could be that the network is down, or the phone got unpaired from our connection + */ + if (diff > refreshInterval + 5) { + this.close() + + if (this.autoReconnect) { + // attempt reconnecting if the user wants us to + this.log('disconnected unexpectedly, reconnecting...') + const reconnectLoop = () => this.connect(null, 25 * 1000).catch(reconnectLoop) + reconnectLoop() // keep trying to connect + } else { + this.unexpectedDisconnect('lost connection unexpectedly') + } + } else { + // if its all good, send a keep alive request + this.send('?,,') + } + }, refreshInterval * 1000) + } +} diff --git a/WAConnection/Constants.ts b/WAConnection/Constants.ts new file mode 100644 index 0000000..336c883 --- /dev/null +++ b/WAConnection/Constants.ts @@ -0,0 +1,73 @@ +import { WA } from '../Binary/Constants' +import { proto } from '../Binary/WAMessage' + +export interface AuthenticationCredentials { + clientID: string + serverToken: string + clientToken: string + encKey: Buffer + macKey: Buffer +} +export interface AuthenticationCredentialsBase64 { + clientID: string + serverToken: string + clientToken: string + encKey: string + macKey: string +} +export interface UserMetaData { + id: string + name: string + phone: string +} +export type WANode = WA.Node +export type WAMessage = proto.WebMessageInfo +export type WAMessageContent = proto.IMessage + +export interface WAGroupCreateResponse { + status: number + gid?: string + participants?: { [key: string]: any } +} +export interface WAGroupMetadata { + id: string + owner: string + subject: string + creation: number + participants: [{ id: string; isAdmin: boolean; isSuperAdmin: boolean }] +} +export interface WAGroupModification { + status: number + participants?: { [key: string]: any } +} + +export interface WAContact { + notify?: string + jid: string + name?: string + index?: string + short?: string +} +export interface WAChat { + t: string + count: string + spam: 'false' | 'true' + jid: string + modify_tag: string +} +export enum WAMetric { + liveLocation = 3, + group = 10, + message = 16, + queryLiveLocation = 33, +} +export enum WAFlag { + ignore = 1 << 7, + acknowledge = 1 << 6, + available = 1 << 5, + unavailable = 1 << 4, + expires = 1 << 3, + skipOffline = 1 << 2, +} +/** Tag used with binary queries */ +export type WATag = [WAMetric, WAFlag] diff --git a/WAConnection/Tests.ts b/WAConnection/Tests.ts new file mode 100644 index 0000000..3c23359 --- /dev/null +++ b/WAConnection/Tests.ts @@ -0,0 +1,58 @@ +import assert from 'assert' +import WAConnection from './WAConnection' +import { AuthenticationCredentialsBase64 } from './Constants' + +describe('QR generation', () => { + it('should generate QR', async () => { + const conn = new WAConnection() + let calledQR = false + conn.onReadyForPhoneAuthentication = ([ref, curveKey, clientID]) => { + assert.ok(ref, 'ref nil') + assert.ok(curveKey, 'curve key nil') + assert.ok(clientID, 'client ID nil') + calledQR = true + } + await assert.rejects(async () => conn.connectSlim(null, 5000), 'should have failed connect') + assert.equal(calledQR, true, 'QR not called') + }) +}) + +describe('Test Connect', () => { + let auth: AuthenticationCredentialsBase64 + it('should connect', async () => { + console.log('please be ready to scan with your phone') + const conn = new WAConnection() + await assert.doesNotReject(async () => conn.connectSlim(null), 'initial connection failed') + assert.ok(conn.userMetaData) + assert.ok(conn.userMetaData.id) + + conn.close() + auth = conn.base64EncodedAuthInfo() + }) + it('should reconnect', async () => { + const conn = new WAConnection() + + const [user, chats, contacts, unread] = await conn.connect('./auth_info.json', 20 * 1000) + + assert.ok(user) + assert.ok(user.id) + + assert.ok(chats) + if (chats.length > 0) { + assert.ok(chats[0].jid) + assert.ok(chats[0].count) + } + assert.ok(contacts) + if (contacts.length > 0) { + assert.ok(contacts[0].jid) + } + assert.ok(unread) + if (unread.length > 0) { + assert.ok(unread[0].key) + } + + await conn.logout() + + await assert.rejects(async () => conn.connectSlim(auth), 'reconnect should have failed') + }) +}) diff --git a/WAConnection/Utils.ts b/WAConnection/Utils.ts new file mode 100644 index 0000000..c6f4c08 --- /dev/null +++ b/WAConnection/Utils.ts @@ -0,0 +1,70 @@ +import Crypto from 'crypto' +import HKDF from 'futoin-hkdf' + +/** decrypt AES 256 CBC; where the IV is prefixed to the buffer */ + +export function aesDecrypt(buffer: Buffer, key: Buffer) { + return aesDecryptWithIV(buffer.slice(16, buffer.length), key, buffer.slice(0, 16)) +} +/** decrypt AES 256 CBC */ +export function aesDecryptWithIV(buffer: Buffer, key: Buffer, IV: Buffer) { + const aes = Crypto.createDecipheriv('aes-256-cbc', key, IV) + return Buffer.concat([aes.update(buffer), aes.final()]) +} +// encrypt AES 256 CBC; where a random IV is prefixed to the buffer +export function aesEncrypt(buffer: Buffer, key: Buffer) { + const IV = randomBytes(16) + const aes = Crypto.createCipheriv('aes-256-cbc', key, IV) + return Buffer.concat([IV, aes.update(buffer), aes.final()]) // prefix IV to the buffer +} +// encrypt AES 256 CBC with a given IV +export function aesEncrypWithIV(buffer: Buffer, key: Buffer, IV: Buffer) { + const aes = Crypto.createCipheriv('aes-256-cbc', key, IV) + return Buffer.concat([aes.update(buffer), aes.final()]) // prefix IV to the buffer +} +// sign HMAC using SHA 256 +export function hmacSign(buffer: Buffer, key: Buffer) { + return Crypto.createHmac('sha256', key).update(buffer).digest() +} +export function sha256(buffer: Buffer) { + return Crypto.createHash('sha256').update(buffer).digest() +} +// HKDF key expansion +export function hkdf(buffer: Buffer, expandedLength: number, info = null) { + return HKDF(buffer, expandedLength, { salt: Buffer.alloc(32), info: info, hash: 'SHA-256' }) +} +// generate a buffer with random bytes of the specified length +export function randomBytes(length) { + return Crypto.randomBytes(length) +} +export function promiseTimeout(ms: number, promise: Promise) { + // Create a promise that rejects in milliseconds + const timeout = new Promise((_, reject) => { + const id = setTimeout(() => { + clearTimeout(id) + reject('Timed out') + }, ms) + }) + return Promise.race([promise, timeout]) as Promise +} +// whatsapp requires a message tag for every message, we just use the timestamp as one +export function generateMessageTag() { + return new Date().getTime().toString() +} +// generate a random 16 byte client ID +export function generateClientID() { + return randomBytes(16).toString('base64') +} +// generate a random 10 byte ID to attach to a message +export function generateMessageID() { + return randomBytes(10).toString('hex').toUpperCase() +} + +export function errorOnNon200Status(p: Promise) { + return p.then((json) => { + if (json.status && typeof json.status === 'number' && Math.floor(json.status / 100) !== 2) { + throw new Error(`Unexpected status code: ${json.status}`) + } + return json + }) +} diff --git a/WAConnection/Validation.ts b/WAConnection/Validation.ts new file mode 100644 index 0000000..1e1d85b --- /dev/null +++ b/WAConnection/Validation.ts @@ -0,0 +1,164 @@ +import * as Curve from 'curve25519-js' +import * as Utils from './Utils' +import WAConnectionBase from './Base' + +export default class WAConnectionValidator extends WAConnectionBase { + /** Authenticate the connection */ + protected async authenticate() { + if (!this.authInfo.clientID) { + // if no auth info is present, that is, a new session has to be established + // generate a client ID + this.authInfo = { + clientID: Utils.generateClientID(), + clientToken: null, + serverToken: null, + encKey: null, + macKey: null, + } + } + + const data = ['admin', 'init', this.version, this.browserDescription, this.authInfo.clientID, true] + return this.query(data) + .then((json) => { + // we're trying to establish a new connection or are trying to log in + switch (json.status) { + case 200: // all good and we can procede to generate a QR code for new connection, or can now login given present auth info + if (this.authInfo.encKey && this.authInfo.macKey) { + // if we have the info to restore a closed session + const data = [ + 'admin', + 'login', + this.authInfo.clientToken, + this.authInfo.serverToken, + this.authInfo.clientID, + 'takeover', + ] + return this.query(data, null, null, 's1') // wait for response with tag "s1" + } else { + return this.generateKeysForAuth(json.ref) + } + default: + throw [json.status, 'unknown error', json] + } + }) + .then((json) => { + switch (json.status) { + case 401: // if the phone was unpaired + throw [json.status, 'unpaired from phone', json] + case 429: // request to login was denied, don't know why it happens + throw [json.status, 'request denied, try reconnecting', json] + case 304: // request to generate a new key for a QR code was denied + throw [json.status, 'request for new key denied', json] + default: + break + } + if (json[1] && json[1].challenge) { + // if its a challenge request (we get it when logging in) + return this.respondToChallenge(json[1].challenge).then((json) => { + if (json.status !== 200) { + // throw an error if the challenge failed + throw [json.status, 'unknown error', json] + } + return this.waitForMessage('s2', []) // otherwise wait for the validation message + }) + } else { + // otherwise just chain the promise further + return json + } + }) + .then((json) => { + this.validateNewConnection(json[1]) // validate the connection + this.log('validated connection successfully') + this.lastSeen = new Date() // set last seen to right now + return this.userMetaData + }) + } + /** + * Once the QR code is scanned and we can validate our connection, or we resolved the challenge when logging back in + * @private + * @param {object} json + */ + private validateNewConnection(json) { + const onValidationSuccess = () => { + // set metadata: one's WhatsApp ID [cc][number]@s.whatsapp.net, name on WhatsApp, info about the phone + this.userMetaData = { + id: json.wid.replace('@c.us', '@s.whatsapp.net'), + name: json.pushname, + phone: json.phone, + } + return this.userMetaData + } + + if (json.connected) { + // only if we're connected + if (!json.secret) { + // if we didn't get a secret, we don't need it, we're validated + return onValidationSuccess() + } + const secret = Buffer.from(json.secret, 'base64') + if (secret.length !== 144) { + throw [4, 'incorrect secret length: ' + secret.length] + } + // generate shared key from our private key & the secret shared by the server + const sharedKey = Curve.sharedKey(this.curveKeys.private, secret.slice(0, 32)) + // expand the key to 80 bytes using HKDF + const expandedKey = Utils.hkdf(sharedKey as Buffer, 80) + + // perform HMAC validation. + const hmacValidationKey = expandedKey.slice(32, 64) + const hmacValidationMessage = Buffer.concat([secret.slice(0, 32), secret.slice(64, secret.length)]) + + const hmac = Utils.hmacSign(hmacValidationMessage, hmacValidationKey) + + if (hmac.equals(secret.slice(32, 64))) { + // computed HMAC should equal secret[32:64] + // expandedKey[64:] + secret[64:] are the keys, encrypted using AES, that are used to encrypt/decrypt the messages recieved from WhatsApp + // they are encrypted using key: expandedKey[0:32] + const encryptedAESKeys = Buffer.concat([ + expandedKey.slice(64, expandedKey.length), + secret.slice(64, secret.length), + ]) + const decryptedKeys = Utils.aesDecrypt(encryptedAESKeys, expandedKey.slice(0, 32)) + // set the credentials + this.authInfo = { + encKey: decryptedKeys.slice(0, 32), // first 32 bytes form the key to encrypt/decrypt messages + macKey: decryptedKeys.slice(32, 64), // last 32 bytes from the key to sign messages + clientToken: json.clientToken, + serverToken: json.serverToken, + clientID: this.authInfo.clientID, + } + return onValidationSuccess() + } else { + // if the checksums didn't match + throw [5, 'HMAC validation failed'] + } + } else { + // if we didn't get the connected field (usually we get this message when one opens WhatsApp on their phone) + throw [6, 'json connection failed', json] + } + } + /** + * When logging back in (restoring a previously closed session), WhatsApp may challenge one to check if one still has the encryption keys + * WhatsApp does that by asking for us to sign a string it sends with our macKey + */ + protected respondToChallenge(challenge: string) { + const bytes = Buffer.from(challenge, 'base64') // decode the base64 encoded challenge string + const signed = Utils.hmacSign(bytes, this.authInfo.macKey).toString('base64') // sign the challenge string with our macKey + const data = ['admin', 'challenge', signed, this.authInfo.serverToken, this.authInfo.clientID] // prepare to send this signed string with the serverToken & clientID + this.log('resolving login challenge') + return this.query(data) + } + /** + * When starting a new session, generate a QR code by generating a private/public key pair & the keys the server sends + * @private + */ + protected generateKeysForAuth(ref: string) { + this.curveKeys = Curve.generateKeyPair(Utils.randomBytes(32)) + this.onReadyForPhoneAuthentication([ + ref, + Buffer.from(this.curveKeys.public).toString('base64'), + this.authInfo.clientID, + ]) + return this.waitForMessage('s1', []) + } +} diff --git a/WAConnection/WAConnection.ts b/WAConnection/WAConnection.ts new file mode 100644 index 0000000..033fcdd --- /dev/null +++ b/WAConnection/WAConnection.ts @@ -0,0 +1,2 @@ +import WAConnection from './Connect' +export default WAConnection diff --git a/WhatsAppWeb.Query.js b/WhatsAppWeb.Query.js deleted file mode 100644 index 14fdbff..0000000 --- a/WhatsAppWeb.Query.js +++ /dev/null @@ -1,204 +0,0 @@ -/* - Contains the code for sending queries to WhatsApp -*/ -module.exports = { - /** - * Query whether a given number is registered on WhatsApp - * @param {string} jid the number you want to query, format as [number]@s.whatsapp.net - * @return {Promise<[boolean, string]>} Promise with an array [exists, jid] - */ - isOnWhatsApp: function (jid) { - return this.query(["query", "exist", jid]).then (([m, _]) => [m.status === 200, jid]) - }, - /** - * @param {string} jid the whatsapp ID of the person - * @return {Promise<[object, object]>} - */ - requestPresenceUpdate: function (jid) { - return this.query(["action","presence","subscribe",jid]) - }, - /** - * Query the status of the person (see groupMetadata() for groups) - * @param {string} [jid] the whatsapp ID of the person - * @return {Promise<[object, object]>} - */ - getStatus: function (jid) { - jid = jid || this.userMetaData.id - return this.query(["query","Status",jid]) - }, - /** - * Get the URL to download the profile picture of a person/group - * @param {string} [jid] the whatsapp ID of the person/group (will get your own picture if not specified) - * @return {Promise<[object, object]>} - */ - getProfilePicture: function (jid) { - jid = jid || this.userMetaData.id - return this.query(["query","ProfilePicThumb",jid]) - }, - /** - * @return {Promise<[object, object]>} - */ - getContacts: function () { - const json = ["query", {epoch: this.msgCount.toString(), type: "contacts"}, null] - return this.query(json, [10, 128]) // this has to be an encrypted query - }, - /** - * @return {Promise<[object, object]>} - */ - getChats: function () { - const json = ["query", {epoch: this.msgCount.toString(), type: "chat"}, null] - return this.query(json, [10, 128]) // this has to be an encrypted query - }, - /** - * Check if your phone is connected - * @param {number} timeoutMs max time for the phone to respond - * @return {Promise<[object, object]>} - */ - isPhoneConnected: function (timeoutMs=5000) { - return this.query (["admin", "test"], null, timeoutMs) - .then (([json, q]) => json[1]) - .catch (err => false) - }, - /** - * Load the conversation with a group or person - * @param {string} jid the id of the group or person - * @param {number} count the number of messages to load - * @param {object} [indexMessage] the data for which message to offset the query by - * @param {string} [indexMessage.id] the id of the message - * @param {object} [indexMessage.fromMe] whether the message was sent by yours truly - * @param {boolean} [mostRecentFirst] retreive the most recent message first or retreive from the converation start - * @return {Promise} Promise of the messages loaded - */ - loadConversation: function (jid, count, indexMessage=null, mostRecentFirst=true) { - // construct JSON - let json = [ - "query", - { - epoch: this.msgCount.toString(), - type: "message", - jid: jid, - kind: mostRecentFirst ? "before" : "after", - owner: "true", - count: count.toString() - }, - null - ] - // if we have some index from which we want to query - if (indexMessage) { - json[1].index = indexMessage.id - json[1].owner = indexMessage.fromMe ? "true" : "false" - } - return this.query(json, [10, 128]) - }, - /** - * Load the entire friggin conversation with a group or person - * @param {string} jid the id of the group or person - * @param {function} onMessage callback for every message retreived - * @param {number} [chunkSize] the number of messages to load in a single request - * @param {boolean} [mostRecentFirst] retreive the most recent message first or retreive from the converation start - */ - loadEntireConversation: function (jid, onMessage, chunkSize=25, mostRecentFirst=true) { - var offsetID = null - - const loadMessage = () => { - return this.loadConversation(jid, chunkSize, offsetID, mostRecentFirst) - .then (([json]) => { - if (json[2]) { - // callback with most recent message first (descending order of date) - let lastMessage - if (mostRecentFirst) { - for (var i = json[2].length-1; i >= 0;i--) { - onMessage(json[2][i][2]) - lastMessage = json[2][i][2] - } - } else { - for (var i = 0; i < json[2].length;i++) { - onMessage(json[2][i][2]) - lastMessage = json[2][i][2] - } - } - // if there are still more messages - if (json[2].length >= chunkSize) { - offsetID = lastMessage.key // get the last message - return new Promise ((resolve, reject) => { - // send query after 200 ms - setTimeout( () => loadMessage().then (resolve).catch(reject), 200) - }) - } - } - }) - } - - return loadMessage() - }, - /** - * Get the metadata of the group - * @param {string} jid the ID of the group - * @return {Promise<[object, object]>} - */ - groupMetadata: function (jid) { - return this.query (["query", "GroupMetadata", jid]) - }, - /** - * Create a group - * @param {string} title like, the title of the group - * @param {string[]} participants people to include in the group - * @return {Promise<[object, object]>} - */ - groupCreate: function (title, participants) { - return this.groupQuery ("create", null, title, participants) - }, - /** - * Leave a group - * @param {string} jid the ID of the group - * @return {Promise<[object, object]>} - */ - groupLeave: function (jid) { - return this.groupQuery ("leave", jid) - }, - /** - * Update the title of the group - * @param {string} jid the ID of the group - * @param {string} title the new title of the group - * @return {Promise<[object, object]>} - */ - groupUpdateTitle: function (jid, title) { - return this.groupQuery ("subject", jid, title) - }, - /** - * Add somebody to the group - * @param {string} jid the ID of the group - * @param {string[]} participants the people to add - * @return {Promise<[object, object]>} - */ - groupAdd: function (jid, participants) { - return this.groupQuery ("add", jid, null, participants) - }, - /** - * Remove somebody from the group - * @param {string} jid the ID of the group - * @param {string[]} participants the people to remove - * @return {Promise<[object, object]>} - */ - groupRemove: function (jid, participants) { - return this.groupQuery ("remove", jid, null, participants) - }, - /** - * Make someone admin on the group - * @param {string} jid the ID of the group - * @param {string[]} participants the people to make admin - * @return {Promise<[object, object]>} - */ - groupMakeAdmin: function (jid, participants) { - return this.groupQuery ("promote", jid, null, participants) - }, - /** - * Get the invite link of the group - * @param {string} jid the ID of the group - * @return {Promise} - */ - groupInviteCode: function (jid) { - const json = ["query", "inviteCode", jid] - return this.query (json).then (([json, _]) => json.code) - } -} diff --git a/WhatsAppWeb.Recv.js b/WhatsAppWeb.Recv.js deleted file mode 100644 index 6b6b1fa..0000000 --- a/WhatsAppWeb.Recv.js +++ /dev/null @@ -1,257 +0,0 @@ -const Utils = require("./WhatsAppWeb.Utils") -const fs = require("fs") -const fetch = require("node-fetch") -/* - Contains the code for recieving messages and forwarding what to do with them to the correct functions -*/ -module.exports = { - /** - * Called when a message is recieved on the socket - * @private - * @param {string|buffer} message - * @param {function(any)} reject - */ - onMessageRecieved: function (message) { - if (message[0] === "!") { // when the first character in the message is an '!', the server is updating the last seen - const timestamp = message.slice(1,message.length) - this.lastSeen = new Date( parseInt(timestamp) ) - } else { - const commaIndex = message.indexOf(",") // all whatsapp messages have a tag and a comma, followed by the actual message - - if (commaIndex < 0) { // if there was no comma, then this message must be not be valid - return this.gotError([2, "invalid message", message]) - } - - var data = message.slice(commaIndex+1, message.length) - // get the message tag. - // If a query was done, the server will respond with the same message tag we sent the query with - const messageTag = message.slice(0, commaIndex).toString () - if (data.length === 0) { - // got an empty message, usually get one after sending a query with the 128 tag - return - } - - let json - if (data[0] === "[" || data[0] === "{") { // if the first character is a "[", then the data must just be plain JSON array or object - json = JSON.parse( data ) // parse the JSON - } else if (this.authInfo.macKey && this.authInfo.encKey) { - /* - If the data recieved was not a JSON, then it must be an encrypted message. - Such a message can only be decrypted if we're connected successfully to the servers & have encryption keys - */ - const checksum = data.slice(0, 32) // the first 32 bytes of the buffer are the HMAC sign of the message - data = data.slice(32, data.length) // the actual message - - const computedChecksum = Utils.hmacSign(data, this.authInfo.macKey) // compute the sign of the message we recieved using our macKey - - if (checksum.equals(computedChecksum)) { // the checksum the server sent, must match the one we computed for the message to be valid - const decrypted = Utils.aesDecrypt(data, this.authInfo.encKey) // decrypt using AES - json = this.decoder.read( decrypted ) // decode the binary message into a JSON array - } else { - this.unexpectedDisconnect([7, "checksums don't match"]) - return - } - } else { - // if we recieved a message that was encrypted but we don't have the keys, then there must be an error - this.unexpectedDisconnect([3, "recieved encrypted message when auth creds not available", message]) - return - } - /* - Check if this is a response to a message we sent - */ - if (this.callbacks[messageTag]) { - const q = this.callbacks[messageTag] - //console.log (messageTag + ", " + q.queryJSON) - q.callback([json, q.queryJSON]) - delete this.callbacks[messageTag] - return - } - /* - Check if this is a response to a message we are expecting - */ - if (this.callbacks["function:" + json[0]]) { - let callbacks = this.callbacks["function:" + json[0]] - var callbacks2 - var callback - for (var key in json[1] || {}) { - callbacks2 = callbacks[key + ":" + json[1][key]] - if (callbacks2) { break } - } - if (!callbacks2) { - for (var key in json[1] || {}) { - callbacks2 = callbacks[key] - if (callbacks2) { break } - } - } - if (!callbacks2) { - callbacks2 = callbacks[""] - } - if (callbacks2) { - callback = callbacks2[ json[2] && json[2][0][0] ] - if (!callback) { - callback = callbacks2[""] - } - } - if (callback) { - callback (json) - return - } - } - if (this.logUnhandledMessages) { - this.log("[Unhandled] " + messageTag + ", " + JSON.stringify(json)) - } - } - }, - /** - * Type of notification - * @param {object} message - * @param {object} [message.message] should be present for actual encrypted messages - * @param {object} [message.messageStubType] should be present for group add, leave etc. notifications - * @return {[string, string]} [type of notification, specific type of message] - */ - getNotificationType: function (message) { - const MessageStubTypes = { - 20: "addedToGroup", - 32: "leftGroup", - 39: "createdGroup" - } - if (message.message) { - return ["message", Object.keys(message.message)[0]] - } else if (message.messageStubType) { - return [MessageStubTypes[message.messageStubType] , null] - } else { - return ["unknown", null] - } - }, - /** - * Register for a callback for a certain function, will cancel automatically after one execution - * @param {[string, object, string] | string} parameters name of the function along with some optional specific parameters - * @return {promise} when the function is received - */ - registerCallbackOneTime: function (parameters) { - return new Promise ((resolve, reject) => this.registerCallback (parameters, resolve)) - .finally (json => { - this.deregisterCallback (parameters) - return json - }) - }, - /** - * Register for a callback for a certain function - * @param {[string, string, string] | string} parameters name of the function along with some optional specific parameters - * @param {function(any)} callback - */ - registerCallback: function (parameters, callback) { - if (typeof parameters === "string") { - return this.registerCallback ([parameters], callback) - } - if (!Array.isArray (parameters)) { - throw "parameters (" + parameters + ") must be a string or array" - } - const func = "function:" + parameters[0] - const key = parameters[1] || "" - const key2 = parameters[2] || "" - if (!this.callbacks[func]) { - this.callbacks[func] = {} - } - if (!this.callbacks[func][key]) { - this.callbacks[func][key] = {} - } - this.callbacks[func][key][key2] = callback - }, - /** - * Cancel all further callback events associated with the given parameters - * @param {[string, object, string] | string} parameters name of the function along with some optional specific parameters - */ - deregisterCallback: function (parameters) { - if (typeof parameters === "string") { - return this.deregisterCallback ([parameters]) - } - if (!Array.isArray (parameters)) { - throw "parameters (" + parameters + ") must be a string or array" - } - const func = "function:" + parameters[0] - const key = parameters[1] || "" - const key2 = parameters[2] || "" - if (this.callbacks[func] && this.callbacks[func][key] && this.callbacks[func][key][key2]) { - delete this.callbacks[func][key][key2] - return - } - this.log ("WARNING: could not find " + JSON.stringify (parameters) + " to deregister") - }, - /** - * Wait for a message with a certain tag to be received - * @param {string} tag the message tag to await - * @param {object} [json] query that was sent - * @param {number} [timeoutMs] timeout after which the promise will reject - */ - waitForMessage: function (tag, json, timeoutMs) { - const promise = new Promise((resolve, reject) => - this.callbacks[tag] = {queryJSON: json, callback: resolve, errCallback: reject}) - if (timeoutMs) { - return Utils.promiseTimeout (timeoutMs, promise) - .catch (err => { - delete this.callbacks[tag] - throw err - }) - } else { - return promise - } - }, - /** - * Decode a media message (video, image, document, audio) & save it to the given file - * @param {object} message the media message you want to decode - * @param {string} filename the name of the file where the media will be saved - * @return {Promise} promise once the file is successfully saved, with the metadata - */ - decodeMediaMessage: async function (message, filename) { - const getExtension = (mimetype) => mimetype.split(";")[0].split("/")[1] - - /* - One can infer media type from the key in the message - it is usually written as [mediaType]Message. Eg. imageMessage, audioMessage etc. - */ - let type = Object.keys(message)[0] - if (!type) { - throw "unknown message type" - } - if (type === "extendedTextMessage" || type === "conversation") { - throw "cannot decode text message" - } - if (type === "locationMessage" || type === "liveLocationMessage") { - fs.writeFileSync (filename + ".jpeg", message[type].jpegThumbnail) - return {filename: filename + ".jpeg"} - } - - message = message[type] - // get the keys to decrypt the message - const mediaKeys = Utils.getMediaKeys(Buffer.from(message.mediaKey, 'base64'), type) - const iv = mediaKeys.iv - const cipherKey = mediaKeys.cipherKey - const macKey = mediaKeys.macKey - - // download the message - const fetched = await fetch(message.url) - const buffer = await fetched.buffer() - // first part is actual file - let file = buffer.slice(0, buffer.length-10) - // last 10 bytes is HMAC sign of file - let mac = buffer.slice(buffer.length-10, buffer.length) - - // sign IV+file & check for match with mac - let testBuff = Buffer.concat([iv, file]) - let sign = Utils.hmacSign(testBuff, macKey).slice(0, 10) - // our sign should equal the mac - if (sign.equals(mac)) { - let decrypted = Utils.aesDecryptWithIV(file, cipherKey, iv) // decrypt media - - const trueFileName = filename + "." + getExtension(message.mimetype) - fs.writeFileSync(trueFileName, decrypted) - - message.filename = trueFileName - return message - } else { - throw "HMAC sign does not match" - } - } - -} \ No newline at end of file diff --git a/WhatsAppWeb.Send.js b/WhatsAppWeb.Send.js deleted file mode 100644 index 590bb14..0000000 --- a/WhatsAppWeb.Send.js +++ /dev/null @@ -1,329 +0,0 @@ -const Utils = require("./WhatsAppWeb.Utils") -const fetch = require('node-fetch') -/* - Contains the code for sending stuff to WhatsApp -*/ -/** - * @typedef {Object} MessageOptions - * @property {Object} [quoted] the message you may wanna quote along with this message - * @property {Date} [timestamp] optionally set the timestamp of the message in Unix time MS - * @property {string} [caption] (for media messages) caption to go along with the media - * @property {string} [thumbnail] (for media & location messages) base64 encoded thumbnail - * @property {string} [mimetype] (for media messages) specify the Mimetype of the media, required for document messages - * @property {boolean} [gif] (for video messages) whether the media is a gif or not - */ -module.exports = { - /** - * Send a read receipt to the given ID for a certain message - * @param {string} jid the ID of the person/group whose message you read - * @param {string} messageID the message ID - * @return {Promise<[object, object]>} - */ - sendReadReceipt: function (jid, messageID) { - const json = [ - "action", - { epoch: this.msgCount.toString(), type: "set" }, - [ ["read", {count: "1", index: messageID, jid: jid, owner: "false"}, null] ] - ] - return this.query(json, [10, 128]) // encrypt and send off - }, - /** - * Tell someone about your presence -- online, typing, offline etc. - * @param {string} jid the ID of the person/group who you are updating - * @param {string} type your presence - * @return {Promise<[object, object]>} - */ - updatePresence: function (jid, type) { - const json = [ - "action", - { epoch: this.msgCount.toString(), type: "set" }, - [ ["presence", {type: type, to: jid}, null] ] - ] - return this.query(json, [10, 64]) - }, - /** - * Send a text message - * @param {string} id the JID of the person/group you're sending the message to - * @param {string} txt the actual text of the message - * @param {MessageOptions} [options] some additional options - * @return {Promise<[object, object]>} - */ - sendTextMessage: function (id, txt, options={}) { - if (typeof txt !== "string") { - return Promise.reject("expected text to be a string") - } - let message - if (options.quoted) { - message = {extendedTextMessage: { text: txt }} - } else { - message = {conversation: txt} - } - return this.sendMessage(id, message, options) - }, - /** - * Send a contact message - * @param {string} id the JID of the person/group you're sending the message to - * @param {string} displayName the name of the person on the contact, will be displayed on WhatsApp - * @param {string} vcard the VCARD formatted contact - * @param {MessageOptions} [options] some additional options - * @return {Promise<[object, object]>} - */ - sendContactMessage: function (id, displayName, vcard, options={}) { - if (typeof displayName !== "string") { - return Promise.reject("expected text to be a string") - } - return this.sendMessage(id, {contactMessage: {displayName: displayName, vcard: vcard}}, options) - }, - /** - * Send a location message - * @param {string} id the JID of the person/group you're sending the message to - * @param {number} lat the latitude of the location - * @param {number} long the longitude of the location - * @param {MessageOptions} [options] some additional options - * @return {Promise<[object, object]>} - */ - sendLocationMessage: function (id, lat, long, options={}) { - return this.sendMessage(id, {locationMessage: {degreesLatitude: lat, degreesLongitude: long}}, options) - }, - /** - * Send a media message - * @param {string} id the JID of the person/group you're sending the message to - * @param {Buffer} buffer the buffer of the actual media you're sending - * @param {string} mediaType the type of media, can be one of [imageMessage, documentMessage, stickerMessage, videoMessage] - * @param {MessageOptions} [options] additional information about the message - * @return {Promise<[object, object]>} - */ - sendMediaMessage: function (id, buffer, mediaType, options={}) { - // path to upload the media - const mediaPathMap = { - imageMessage: "/mms/image", - videoMessage: "/mms/video", - documentMessage: "/mms/document", - audioMessage: "/mms/audio", - stickerMessage: "/mms/image" - } - // gives WhatsApp info to process the media - const defaultMimetypeMap = { - imageMessage: "image/jpeg", - videoMessage: "video/mp4", - documentMessage: "appliction/pdf", - audioMessage: "audio/ogg; codecs=opus", - stickerMessage: "image/webp" - } - if (!options) { - options = {} - } - if (mediaType === "conversation" || mediaType === "extendedTextMessage") { - return Promise.reject("use sendTextMessage() to send text messages") - } - if (mediaType === "documentMessage" && !options.mimetype) { - return Promise.reject("mimetype required to send a document") - } - if (mediaType === "stickerMessage" && options.caption) { - return Promise.reject("cannot send a caption with a sticker") - } - if (!options.mimetype) { - options.mimetype = defaultMimetypeMap[mediaType] - } - - // generate a media key - const mediaKey = Utils.randomBytes(32) - const mediaKeys = Utils.getMediaKeys(mediaKey, mediaType) - const enc = Utils.aesEncrypWithIV(buffer, mediaKeys.cipherKey, mediaKeys.iv) - const mac = Utils.hmacSign(Buffer.concat([mediaKeys.iv, enc]), mediaKeys.macKey).slice(0, 10) - const body = Buffer.concat([enc, mac]) // body is enc + mac - const fileSha256 = Utils.sha256(buffer) - // url safe Base64 encode the SHA256 hash of the body - const fileEncSha256B64 = Utils.sha256(body).toString('base64').replace(/\+/g, '-').replace(/\//g, '_').replace(/\=+$/, '') - - return Utils.generateThumbnail(buffer, mediaType, options) - .then (() => this.query(["query", "mediaConn"])) // send a query JSON to obtain the url & auth token to upload our media - .then (([json,_]) => { - json = json.media_conn - const auth = json.auth // the auth token - let hostname = "https://" + json.hosts[0].hostname // first hostname available - hostname += mediaPathMap[mediaType] + "/" + fileEncSha256B64 // append path - hostname += "?auth=" + auth // add auth token - hostname += "&token=" + fileEncSha256B64 // file hash - - return fetch(hostname, {method: 'POST', body: body, headers: {Origin: "https://web.whatsapp.com"}}) - }) - .then (res => res.json()) - .then (json => { - if (json.url) { - return json.url - } else { - throw "UPLOAD FAILED GOT: " + JSON.stringify(json) - } - }) - .then (url => { - let message = {} - message[mediaType] = { - url: url, - mediaKey: mediaKey.toString('base64'), - mimetype: options.mimetype, - fileEncSha256: fileEncSha256B64, - fileSha256: fileSha256.toString('base64'), - fileLength: buffer.length - } - if (mediaType === "videoMessage" && options.gif) { - message[mediaType].gifPlayback = options.gif - } - return this.sendMessage(id, message, options) - }) - }, - /** - * Generic send message function - * @private - * @param {string} id who to send the message to - * @param {object} message like, the message - * @param {MessageOptions} [options] some additional options - * @return {Promise<[object, object]>} array of the recieved JSON & the query JSON - */ - sendMessage: function (id, message, options) { - if (!options.timestamp) { // if no timestamp was provided, - options.timestamp = new Date() // set timestamp to now - } - const key = Object.keys(message)[0] - const timestamp = options.timestamp.getTime()/1000 - const quoted = options.quoted - if (quoted) { - const participant = quoted.key.participant || quoted.key.remoteJid - message[key].contextInfo = { - participant: participant, - stanzaId: quoted.key.id, - quotedMessage: quoted.message - } - // if a participant is quoted, then it must be a group - // hence, remoteJid of group must also be entered - if (quoted.key.participant) { - message[key].contextInfo.remoteJid = quoted.key.remoteJid - } - } - if (options.caption) { - message[key].caption = options.caption - } - if (options.thumbnail) { - if (typeof options.thumbnail !== "string") { - return Promise.reject("expected JPEG to be a base64 encoded string") - } - message[key].jpegThumbnail = options.thumbnail - } - - let messageJSON = { - key: { - remoteJid: id, - fromMe: true, - id: Utils.generateMessageID() - }, - message: message, - messageTimestamp: timestamp, - status: "ERROR" - } - - if (id.includes ("@g.us")) { - messageJSON.participant = this.userMetaData.id - } - const json = [ - "action", - {epoch: this.msgCount.toString(), type: "relay"}, - [ ["message", null, messageJSON] ] - ] - return this.query(json, [16, 128], null, messageJSON.key.id) - }, - /** - * Generic function for group queries - * @param {string} type the type of query - * @param {string} [jid] the id of the group - * @param {string} [subject] title to attach to the group - * @param {string[]} [participants] the people the query will affect - * @return {Promise<[object, object]>} array of the recieved JSON & the query JSON - */ - groupQuery: function (type, jid, subject, participants) { - let json = [ - "group", - { - author: this.userMetaData.id, - id: Utils.generateMessageTag(), - type: type - }, - null - ] - if (participants) { - json[2] = participants.map (str => ["participant", {jid: str}, null]) - } - if (jid) { - json[1].jid = jid - } - if (subject) { - json[1].subject = subject - } - json = [ - "action", - {type: "set", epoch: this.msgCount.toString()}, - [json] - ] - return this.query (json, [10, 128]) - }, - /** - * Query something from the WhatsApp servers - * @param {any[]} json the query itself - * @param {[number, number]} [binaryTags] the tags to attach if the query is supposed to be sent encoded in binary - * @param {Number} [timeoutMs] timeout after which the query will be failed (set to null to disable a timeout) - * @param {string} [tag] the tag to attach to the message - * @return {Promise<[object, object]>} array of the recieved JSON & the query JSON - */ - query: function (json, binaryTags, timeoutMs, tag) { - if (binaryTags) { - tag = this.sendBinary(json, binaryTags, tag) - } else { - tag = this.sendJSON(json, tag) - } - return this.waitForMessage (tag, json, timeoutMs) - }, - /** - * Send a binary encoded message - * @private - * @param {[string, object, [string, object, object][]]} json the message to encode & send - * @param {[number, number]} tags the binary tags to tell WhatsApp what the message is all about - * @param {string} [tag] the tag to attach to the message - * @return {string} the message tag - */ - sendBinary: function (json, tags, tag) { - const binary = this.encoder.write(json) // encode the JSON to the WhatsApp binary format - - var buff = Utils.aesEncrypt(binary, this.authInfo.encKey) // encrypt it using AES and our encKey - const sign = Utils.hmacSign(buff, this.authInfo.macKey) // sign the message using HMAC and our macKey - tag = tag || Utils.generateMessageTag() - buff = Buffer.concat([ - Buffer.from(tag + ","), // generate & prefix the message tag - Buffer.from(tags), // prefix some bytes that tell whatsapp what the message is about - sign, // the HMAC sign of the message - buff // the actual encrypted buffer - ]) - this.send(buff) // send it off - return tag - }, - /** - * Send a plain JSON message to the WhatsApp servers - * @private - * @param {[any]} json the message to send - * @param {string} [tag] the tag to attach to the message - * @return {string} the message tag - */ - sendJSON: function (json, tag) { - const str = JSON.stringify(json) - tag = tag || Utils.generateMessageTag() - this.send(tag + "," + str) - return tag - }, - /** - * Send some message to the WhatsApp servers - * @private - * @param {any} json the message to send - */ - send: function (m) { - this.msgCount += 1 // increment message count, it makes the 'epoch' field when sending binary messages - this.conn.send( m ) - } -} \ No newline at end of file diff --git a/WhatsAppWeb.Session.js b/WhatsAppWeb.Session.js deleted file mode 100644 index 4615051..0000000 --- a/WhatsAppWeb.Session.js +++ /dev/null @@ -1,311 +0,0 @@ -const WebSocket = require('ws') -const Curve = require ('curve25519-js') -const Utils = require('./WhatsAppWeb.Utils') -/* - Contains the code for connecting to WhatsApp Web, establishing a new session & logging back in -*/ -module.exports = { - /** - * Connect to WhatsAppWeb - * @param {Object} [authInfo] credentials to log back in - * @param {number} [timeoutMs] timeout after which the connect will fail, set to null for an infinite timeout - * @return {[object, object[], object[], object[]]} returns [userMetaData, chats, contacts, unreadMessages] - */ - connect: async function (authInfo, timeoutMs) { - const userInfo = await this.connectSlim (authInfo, timeoutMs) - const chats = await this.receiveChatsAndContacts (authInfo, timeoutMs) - return [userInfo, ...chats] - }, - /** - * Connect to WhatsAppWeb, resolves without waiting for chats & contacts - * @param {Object} [authInfo] credentials to log back in - * @param {number} [timeoutMs] timeout after which the connect will fail, set to null for an infinite timeout - * @return {Promise} returns [userMetaData, chats, contacts, unreadMessages] - */ - connectSlim: function (authInfo, timeoutMs) { - // set authentication credentials if required - if (authInfo) { - this.authInfo = Object.assign ({}, authInfo) // copy credentials - this.authInfo.encKey = Buffer.from(authInfo.encKey, 'base64') // decode from base64 - this.authInfo.macKey = Buffer.from(authInfo.macKey, 'base64') - } - // if we're already connected, throw an error - if (this.conn) { - return Promise.reject([1, "already connected or connecting"]) - } - this.conn = new WebSocket("wss://web.whatsapp.com/ws", {origin: "https://web.whatsapp.com"}) - - let promise = new Promise ( (resolve, reject) => { - this.conn.on('open', () => { - this.conn.on('message', m => this.onMessageRecieved(m)) // in WhatsAppWeb.Recv.js - this.beginAuthentication ().then (resolve).catch (reject) - }) - this.conn.on('error', error => { // if there was an error in the WebSocket - this.close() - reject (error) - }) - }) - promise = timeoutMs ? Utils.promiseTimeout (timeoutMs, promise) : promise - return promise.catch (err => {this.close (); throw err;}) - }, - /** - * Once a connection has been successfully established - * @private - * @return {promise} - */ - beginAuthentication: function () { - this.log("connected to WhatsApp Web") - - if (!this.authInfo.clientID) { // if no auth info is present, that is, a new session has to be established - this.authInfo = { clientID: Utils.generateClientID() } // generate a client ID - } - - const data = ["admin", "init", this.version, this.browserDescriptions, this.authInfo.clientID, true] - return this.query(data) - .then (([json, _]) => { - // we're trying to establish a new connection or are trying to log in - switch (json.status) { - case 200: // all good and we can procede to generate a QR code for new connection, or can now login given present auth info - if (this.authInfo.encKey && this.authInfo.macKey) { // if we have the info to restore a closed session - const data = ["admin", "login", this.authInfo.clientToken, this.authInfo.serverToken, this.authInfo.clientID, "takeover"] - return this.query(data, null, null, "s1") // wait for response with tag "s1" - } else { - return this.generateKeysForAuth(json.ref) - } - default: - throw [json.status, "unknown error", json] - } - }) - .then (([json, q]) => { - switch (json.status) { - case 401: // if the phone was unpaired - throw [json.status, "unpaired from phone", json] - case 429: // request to login was denied, don't know why it happens - throw [json.status, "request denied, try reconnecting", json] - case 304: // request to generate a new key for a QR code was denied - throw [json.status, "request for new key denied", json] - default: - break - } - if (json[1] && json[1].challenge) { // if its a challenge request (we get it when logging in) - return this.respondToChallenge(json[1].challenge) - .then (([json, _]) => { - if (json.status !== 200) { // throw an error if the challenge failed - throw [json.status, "unknown error", json] - } - return this.waitForMessage ("s2", []) // otherwise wait for the validation message - }) - } else { // otherwise just chain the promise further - return [json, q] - } - }) - .then (([json, _]) => { - this.validateNewConnection (json[1]) - this.log("validated connection successfully") - this.lastSeen = new Date() // set last seen to right now - this.startKeepAliveRequest() // start sending keep alive requests (keeps the WebSocket alive & updates our last seen) - }) // validate the connection - .then (() => { - this.log("connected successfully") - return this.userMetaData - }) - }, - /** - * Sets up callbacks to receive chats, contacts & unread messages. - * Must be called immediately after connect - * @returns {[ object[], object[], object[] ]} - [chats, contacts, unreadMessages] - */ - receiveChatsAndContacts: function () { - let chats = [] - let contacts = [] - let unreadMessages = [] - let unreadMap = {} - - let encounteredAddBefore = false - var convoResolve - - this.log ("waiting for chats & contacts") // wait for the message with chats - const waitForConvos = () => new Promise ((resolve, _) => { - convoResolve = resolve - const chatUpdate = (json) => { - const isLast = json[1].last - encounteredAddBefore = json[1].add === "before" ? true : encounteredAddBefore - - json = json[2] - if (json) { - for (var k = json.length-1;k >= 0;k--) { - const message = json[k][2] - const jid = message.key.remoteJid.replace ("@s.whatsapp.net", "@c.us") - if (!message.key.fromMe && unreadMap[jid] > 0) { // only forward if the message is from the sender - unreadMessages.push (message) - unreadMap[jid] -= 1 // reduce - } - } - } - if (isLast) { - // de-register the callbacks, so that they don't get called again - this.deregisterCallback (["action", "add:last"]) - this.deregisterCallback (["action", "add:before"]) - this.deregisterCallback (["action", "add:unread"]) - resolve () - } - } - // wait for actual messages to load, "last" is the most recent message, "before" contains prior messages - this.registerCallback (["action", "add:last"], chatUpdate) - this.registerCallback (["action", "add:before"], chatUpdate) - this.registerCallback (["action", "add:unread"], chatUpdate) - }) - const waitForChats = this.registerCallbackOneTime (["response", "type:chat"]) - .then (json => { - chats = json[2] // chats data (log json to see what it looks like) - chats.forEach (chat => unreadMap [chat[1].jid] = chat[1].count) // store the number of unread messages for each sender - if (chats && chats.length > 0) return waitForConvos () - }) - const waitForContacts = this.registerCallbackOneTime (["response", "type:contacts"]) - .then (json => { - contacts = json[2] - // if no add:before messages are sent, and you receive contacts - // should probably resolve the promise - if (!encounteredAddBefore && convoResolve) convoResolve () - }) - // wait for the chats & contacts to load - return Promise.all ([waitForChats, waitForContacts]).then (() => [chats, contacts, unreadMessages]) - }, - /** - * Once the QR code is scanned and we can validate our connection, or we resolved the challenge when logging back in - * @private - * @param {object} json - */ - validateNewConnection: function (json) { - const onValidationSuccess = () => { - // set metadata: one's WhatsApp ID [cc][number]@s.whatsapp.net, name on WhatsApp, info about the phone - this.userMetaData = {id: json.wid.replace("@c.us", "@s.whatsapp.net"), name: json.pushname, phone: json.phone} - return this.userMetaData - } - - if (json.connected) { // only if we're connected - if (!json.secret) { // if we didn't get a secret, we don't need it, we're validated - return onValidationSuccess() - } - const secret = Buffer.from(json.secret, 'base64') - if (secret.length !== 144) { - throw [4, "incorrect secret length: " + secret.length] - } - // generate shared key from our private key & the secret shared by the server - const sharedKey = Curve.sharedKey( this.curveKeys.private, secret.slice(0, 32) ) - // expand the key to 80 bytes using HKDF - const expandedKey = Utils.hkdf(sharedKey, 80) - - // perform HMAC validation. - const hmacValidationKey = expandedKey.slice(32, 64) - const hmacValidationMessage = Buffer.concat( [ secret.slice(0, 32), secret.slice(64, secret.length) ] ) - - const hmac = Utils.hmacSign(hmacValidationMessage, hmacValidationKey) - - if (hmac.equals(secret.slice(32, 64))) { // computed HMAC should equal secret[32:64] - // expandedKey[64:] + secret[64:] are the keys, encrypted using AES, that are used to encrypt/decrypt the messages recieved from WhatsApp - // they are encrypted using key: expandedKey[0:32] - const encryptedAESKeys = Buffer.concat([ expandedKey.slice(64, expandedKey.length), secret.slice(64, secret.length) ]) - const decryptedKeys = Utils.aesDecrypt(encryptedAESKeys, expandedKey.slice(0,32)) - // set the credentials - this.authInfo = { - encKey: decryptedKeys.slice(0, 32), // first 32 bytes form the key to encrypt/decrypt messages - macKey: decryptedKeys.slice(32, 64), // last 32 bytes from the key to sign messages - clientToken: json.clientToken, - serverToken: json.serverToken, - clientID: this.authInfo.clientID - } - return onValidationSuccess() - } else { // if the checksums didn't match - throw [5, "HMAC validation failed"] - } - } else { // if we didn't get the connected field (usually we get this message when one opens WhatsApp on their phone) - throw [6, "json connection failed", json] - } - }, - /** - * When logging back in (restoring a previously closed session), WhatsApp may challenge one to check if one still has the encryption keys - * WhatsApp does that by asking for us to sign a string it sends with our macKey - * @private - */ - respondToChallenge: function (challenge) { - const bytes = Buffer.from(challenge, 'base64') // decode the base64 encoded challenge string - const signed = Utils.hmacSign(bytes, this.authInfo.macKey).toString('base64') // sign the challenge string with our macKey - const data = ["admin", "challenge", signed, this.authInfo.serverToken, this.authInfo.clientID] // prepare to send this signed string with the serverToken & clientID - this.log("resolving login challenge") - return this.query(data) - }, - /** - * When starting a new session, generate a QR code by generating a private/public key pair & the keys the server sends - * @private - */ - generateKeysForAuth: function (ref) { - this.curveKeys = Curve.generateKeyPair(Utils.randomBytes(32)) - const phoneAuthInfo = [ref, Buffer.from(this.curveKeys.public).toString('base64'), this.authInfo.clientID] - this.onReadyForPhoneAuthentication (phoneAuthInfo) - return this.waitForMessage ("s1", []) - }, - /** - * Send a keep alive request every X seconds, server updates & responds with last seen - * @private - */ - startKeepAliveRequest: function () { - const refreshInterval = 20 - this.keepAliveReq = setInterval(() => { - const diff = (new Date().getTime()-this.lastSeen.getTime())/1000 - /* - check if it's been a suspicious amount of time since the server responded with our last seen - it could be that the network is down, or the phone got unpaired from our connection - */ - if (diff > refreshInterval+5) { - this.close() - - if (this.autoReconnect) { // attempt reconnecting if the user wants us to - this.log("disconnected unexpectedly, reconnecting...") - const reconnectLoop = () => this.connect (null, 25*1000).catch (reconnectLoop) - reconnectLoop () // keep trying to connect - } else { - this.unexpectedDisconnect ("lost connection unexpectedly") - } - } else { // if its all good, send a keep alive request - this.send("?,,") - } - }, refreshInterval * 1000) - }, - /** - * Disconnect from the phone. Your auth credentials become invalid after sending a disconnect request. - * Use close() if you just want to close the connection - * @return {Promise} - */ - logout: function () { - return new Promise ( (resolve, reject) => { - if (this.conn) { - this.conn.send('goodbye,["admin","Conn","disconnect"]', null, () => { - this.authInfo = {} - resolve () - }) - } else { - reject("You're not even connected, you can't log out") - } - }) - .then (() => this.close ()) - }, - /** Close the connection to WhatsApp Web */ - close: function () { - this.msgCount = 0 - if (this.conn) { - this.conn.close() - this.conn = null - } - const keys = Object.keys (this.callbacks) - keys.forEach (key => { - if (!key.includes ("function:")) { - this.callbacks[key].errCallback ("connection closed") - delete this.callbacks[key] - } - } ) - if (this.keepAliveReq) { - clearInterval(this.keepAliveReq) - } - } -} \ No newline at end of file diff --git a/WhatsAppWeb.Utils.js b/WhatsAppWeb.Utils.js deleted file mode 100644 index 99b37ec..0000000 --- a/WhatsAppWeb.Utils.js +++ /dev/null @@ -1,123 +0,0 @@ -const Crypto = require("crypto") -const HKDF = require("futoin-hkdf") -const sharp = require("sharp") -const VideoThumb = require("video-thumb") -const fs = require("fs") - -/* - Basic cryptographic utilities to interact with WhatsApp servers -*/ -module.exports = { - // decrypt AES 256 CBC; where the IV is prefixed to the buffer - aesDecrypt: function (buffer, key) { - return this.aesDecryptWithIV(buffer.slice(16, buffer.length), key, buffer.slice(0,16)) - }, - // decrypt AES 256 CBC - aesDecryptWithIV: function (buffer, key, IV) { - const aes = Crypto.createDecipheriv('aes-256-cbc', key, IV ) - return Buffer.concat( [ aes.update(buffer), aes.final() ] ) - }, - // encrypt AES 256 CBC; where a random IV is prefixed to the buffer - aesEncrypt: function (buffer, key) { - const IV = this.randomBytes(16) - const aes = Crypto.createCipheriv('aes-256-cbc', key, IV) - return Buffer.concat( [ IV, aes.update(buffer), aes.final() ] ) // prefix IV to the buffer - }, - // encrypt AES 256 CBC with a given IV - aesEncrypWithIV: function (buffer, key, IV) { - const aes = Crypto.createCipheriv('aes-256-cbc', key, IV) - return Buffer.concat( [ aes.update(buffer), aes.final() ] ) // prefix IV to the buffer - }, - // sign HMAC using SHA 256 - hmacSign: function (buffer, key) { - return Crypto.createHmac('sha256', key).update(buffer).digest() - }, - sha256: function (buffer) { - return Crypto.createHash('sha256').update(buffer).digest() - }, - // HKDF key expansion - hkdf: function (buffer, expandedLength, info) { - return HKDF(buffer, expandedLength, {salt: Buffer.alloc(32), info: info, hash: 'SHA-256'}) - }, - // generates all the keys required to encrypt/decrypt & sign a media message - getMediaKeys: function (buffer, mediaType) { - // info to put into the HKDF key expansion - const appInfo = { - 'imageMessage': 'WhatsApp Image Keys', - 'videoMessage': 'WhatsApp Video Keys', - 'audioMessage': 'WhatsApp Audio Keys', - 'documentMessage': 'WhatsApp Document Keys', - 'stickerMessage': 'WhatsApp Image Keys' - } - // expand using HKDF to 112 bytes, also pass in the relevant app info - const expandedMediaKey = this.hkdf(buffer, 112, appInfo[mediaType]) - return { - iv: expandedMediaKey.slice(0, 16), - cipherKey: expandedMediaKey.slice(16, 48), - macKey: expandedMediaKey.slice(48, 80) - } - }, - // generates a thumbnail for a given media, if required - generateThumbnail: function (buffer, mediaType, info) { - let promise - if (info.thumbnail === null || info.thumbnail) { // don't do anything if the thumbnail is already provided, or is null - if (mediaType === 'audioMessage') { - promise = Promise.reject("audio messages cannot have thumbnails") - } else { - promise = Promise.resolve() - } - } else { - if (mediaType === 'imageMessage' || mediaType === 'stickerMessage') { - promise = sharp(buffer) // generate a 48x48 thumb - .resize(48, 48) - .jpeg() - .toBuffer() - .then (buffer => info.thumbnail = buffer.toString('base64')) - } else if (mediaType === 'videoMessage') { - const filename = "./" + this.randomBytes(5).toString("hex") + ".mp4" - fs.writeFileSync(filename, buffer) - - promise = new Promise ( (resolve, reject) => { - VideoThumb.extract (filename, filename + ".png", "00:00:00", "48x48", (err) => { - if (err) { - console.log("could not generate video thumb: " + err) - resolve() - } else { - const buff = fs.readFileSync(filename + ".png") - return sharp(buff) - .jpeg() - .toBuffer() - .then (buffer => info.thumbnail = buffer.toString('base64')) - .then (() => { - fs.unlinkSync(filename) - fs.unlinkSync(filename + ".png") - resolve() - }) - } - }) - }) - } else { - promise = Promise.resolve() - } - } - return promise - }, - // generate a buffer with random bytes of the specified length - randomBytes: function (length) { return Crypto.randomBytes(length) }, - promiseTimeout: function(ms, promise) { - // Create a promise that rejects in milliseconds - let timeout = new Promise((_, reject) => { - let id = setTimeout(() => { - clearTimeout(id) - reject('Timed out') - }, ms) - }) - return Promise.race([promise, timeout]) - }, - // whatsapp requires a message tag for every message, we just use the timestamp as one - generateMessageTag: function () { return new Date().getTime().toString() }, - // generate a random 16 byte client ID - generateClientID: function () { return this.randomBytes(16).toString('base64') }, - // generate a random 10 byte ID to attach to a message - generateMessageID: function () { return this.randomBytes(10).toString('hex').toUpperCase() } -} \ No newline at end of file diff --git a/WhatsAppWeb.js b/WhatsAppWeb.js deleted file mode 100644 index 8fed41d..0000000 --- a/WhatsAppWeb.js +++ /dev/null @@ -1,275 +0,0 @@ -const BinaryCoding = require('./binary_coding/binary_encoder.js') -const QR = require('qrcode-terminal') -const Utils = require('./WhatsAppWeb.Utils') - -/** - * @typedef WhatsAppMessage - * @property {Object} key metadata about the sender - * @property {string} key.remoteJid sender ID (could be group or individual) - * @property {bool} key.fromMe - * @property {string} key.id ID of the message - * @property {string} [key.participant] if its a group, which individual sent it - * @property {Object} [message] the actual message - * @property {string} messageTimestamp unix timestamp - * @property {number} [duration] the duration of the live location - */ - -class WhatsAppWeb { - /** - * set of statuses visible to other people; see updatePresence() in WhatsAppWeb.Send - */ - static Presence = { - available: "available", // "online" - unavailable: "unavailable", // "offline" - composing: "composing", // "typing..." - recording: "recording", // "recording..." - paused: "paused" // I have no clue - } - /** - * Status of a message sent or received - */ - static MessageStatus = { - sent: "sent", - received: "received", - read: "read" - } - /** - * set of message types that are supported by the library - */ - static MessageType = { - text: "conversation", - image: "imageMessage", - video: "videoMessage", - sticker: "stickerMessage", - document: "documentMessage", - audio: "audioMessage", - extendedText: "extendedTextMessage", - contact: "contactMessage", - location: "locationMessage", - liveLocation: "liveLocationMessage" - } - /** - * Tells us what kind of message it is - */ - static MessageStubTypes = { - 20: "addedToGroup", - 32: "leftGroup", - 39: "createdGroup" - } - - constructor() { - /** The version of WhatsApp Web we're telling the servers we are */ - this.version = [0,4,1296] - this.browserDescriptions = ["Baileys", "Baileys"] - /** The websocket connection - * @private - */ - this.conn = null - /** Data structure of tokens & IDs used to establish one's identiy to WhatsApp Web */ - this.authInfo = { - clientID: null, - serverToken: null, - clientToken: null, - encKey: null, - macKey: null - } - /** Metadata like WhatsApp id, name set on WhatsApp etc. */ - this.userMetaData = {id: null, name: null, phone: null} - /** @private */ - this.msgCount = 0 // (epoch) number of messages sent to the server; required field for sending messages etc. - /** Shoud reconnect automatically after an unexpected disconnect */ - this.autoReconnect = true // - /** @private */ - this.lastSeen = null // updated by sending a keep alive request to the server, and the server responds with our updated last seen - /** Log messages that are not handled, so you can debug & see what custom stuff you can implement */ - this.logUnhandledMessages = false - /** @private */ - this.callbacks = {} - - /** - * What to do when you need the phone to authenticate the connection (generate QR code by default) - */ - this.onReadyForPhoneAuthentication = this.generateQRCode - this.encoder = new BinaryCoding.Encoder() - this.decoder = new BinaryCoding.Decoder() - - this.unexpectedDisconnect = (err) => { this.close () } - } - /** - * Set the callback for unexpected disconnects - * @param {function(object)} callback - */ - setOnUnexpectedDisconnect (callback) { - this.unexpectedDisconnect = (err) => { - this.close () - callback (err) - } - } - /** - * Set the callback for message status updates (when a message is delivered, read etc.) - * @param {function(object)} callback - */ - setOnMessageStatusChange (callback) { - const func = (json) => { - json = json[1] - var ids = json.id - if (json.cmd === "ack") { - ids = [json.id] - } - const ackTypes = [ - WhatsAppWeb.MessageStatus.sent, - WhatsAppWeb.MessageStatus.received, - WhatsAppWeb.MessageStatus.read - ] - const data = { - from: json.from, - to: json.to, - participant: json.participant, - timestamp: new Date (json.t*1000), - ids: ids, - type: ackTypes[json.ack-1] || "unknown (" + json.ack + ")" - } - callback (data) - } - this.registerCallback ("Msg", func) - this.registerCallback ("MsgInfo", func) - } - /** - * Set the callback for new/unread messages; if someone sends you a message, this callback will be fired - * @param {function(WhatsAppMessage)} callback - * @param {boolean} callbackOnMyMessages - should the callback be fired on a message you sent - */ - setOnUnreadMessage (callback, callbackOnMyMessages=false) { - this.registerCallback (["action", "add:relay", "message"], (json) => { - const message = json[2][0][2] - if (!message.key.fromMe || callbackOnMyMessages) { // if this message was sent to us, notify - callback (message) - } else if (this.logUnhandledMessages) { - this.log (`[Unhandled] message - ${JSON.stringify(message)}`) - } - }) - } - /** - * Set the callback for presence updates; if someone goes offline/online, this callback will be fired - * @param {function(object)} callback - */ - setOnPresenceUpdate (callback) { - this.registerCallback ("Presence", (json) => callback(json[1])) - } - /** - * base 64 encode the authentication credentials and return them - * these can then be used to login again by passing the object to the connect () function. - * @see connect () in WhatsAppWeb.Session - */ - base64EncodedAuthInfo () { - return { - clientID: this.authInfo.clientID, - serverToken: this.authInfo.serverToken, - clientToken: this.authInfo.clientToken, - encKey: this.authInfo.encKey.toString('base64'), - macKey: this.authInfo.macKey.toString('base64') - } - } - /** Generate a QR code from the ref & the curve public key. This is scanned by the phone */ - generateQRCode ([ref, publicKey, clientID]) { - const str = ref + "," + publicKey + "," + clientID - QR.generate(str, {small: true}) - } - - log (text) { console.log (`[Baileys] ${text}`) } -} - -/* Import the rest of the code */ - -const recv = require("./WhatsAppWeb.Recv") -/** Called when a message is recieved on the socket */ -WhatsAppWeb.prototype.onMessageRecieved = recv.onMessageRecieved -/** The type of notification one recieved */ -WhatsAppWeb.prototype.getNotificationType = recv.getNotificationType -/** Register for a callback for a certain function, will cancel automatically after one execution */ -WhatsAppWeb.prototype.registerCallbackOneTime = recv.registerCallbackOneTime -/** Register for a callback for a certain function */ -WhatsAppWeb.prototype.registerCallback = recv.registerCallback -/** Cancel all further callback events associated with the given parameters */ -WhatsAppWeb.prototype.deregisterCallback = recv.deregisterCallback -/** Wait for a message with a certain tag to be received */ -WhatsAppWeb.prototype.waitForMessage = recv.waitForMessage -/** Decode a media message (video, image, document, audio) & save it to the given file */ -WhatsAppWeb.prototype.decodeMediaMessage = recv.decodeMediaMessage - -const session = require("./WhatsAppWeb.Session") -WhatsAppWeb.prototype.connect = session.connect -WhatsAppWeb.prototype.connectSlim = session.connectSlim -WhatsAppWeb.prototype.receiveChatsAndContacts = session.receiveChatsAndContacts -WhatsAppWeb.prototype.beginAuthentication = session.beginAuthentication -WhatsAppWeb.prototype.validateNewConnection = session.validateNewConnection -WhatsAppWeb.prototype.respondToChallenge = session.respondToChallenge -WhatsAppWeb.prototype.generateKeysForAuth = session.generateKeysForAuth -WhatsAppWeb.prototype.startKeepAliveRequest = session.startKeepAliveRequest -WhatsAppWeb.prototype.logout = session.logout -WhatsAppWeb.prototype.close = session.close - -const send = require("./WhatsAppWeb.Send") -/** Send a read receipt to the given ID for a certain message */ -WhatsAppWeb.prototype.sendReadReceipt = send.sendReadReceipt -/** Tell someone about your presence -- online, typing, offline etc. - * @see WhatsAppWeb.Presence for all presence types -*/ -WhatsAppWeb.prototype.updatePresence = send.updatePresence -/** Send a text message */ -WhatsAppWeb.prototype.sendTextMessage = send.sendTextMessage -/** Send a contact message */ -WhatsAppWeb.prototype.sendContactMessage = send.sendContactMessage -/** Send a location message */ -WhatsAppWeb.prototype.sendLocationMessage = send.sendLocationMessage -/** Send a media message */ -WhatsAppWeb.prototype.sendMediaMessage = send.sendMediaMessage -/** @private */ -WhatsAppWeb.prototype.sendMessage = send.sendMessage -/** Generic function for group related queries */ -WhatsAppWeb.prototype.groupQuery = send.groupQuery -/** Query something from the WhatsApp servers */ -WhatsAppWeb.prototype.query = send.query -/** @private */ -WhatsAppWeb.prototype.sendBinary = send.sendBinary -/** @private */ -WhatsAppWeb.prototype.sendJSON = send.sendJSON -/** @private */ -WhatsAppWeb.prototype.send = send.send - -const query = require("./WhatsAppWeb.Query") -/** Query whether a given number is registered on WhatsApp */ -WhatsAppWeb.prototype.isOnWhatsApp = query.isOnWhatsApp -/** Check the presence of a given person (online, offline) */ -WhatsAppWeb.prototype.requestPresenceUpdate = query.requestPresenceUpdate -/** Query the status of the person (see groupMetadata() for groups) */ -WhatsAppWeb.prototype.getStatus = query.getStatus -/** Get the URL to download the profile picture of a person/group */ -WhatsAppWeb.prototype.getProfilePicture = query.getProfilePicture -/** Query all your contacts */ -WhatsAppWeb.prototype.getContacts = query.getContacts -/** Query all the people/groups you have a chat history with */ -WhatsAppWeb.prototype.getChats = query.getChats -/** Query whether your phone is still connected to this WhatsApp Web */ -WhatsAppWeb.prototype.isPhoneConnected = query.isPhoneConnected -/** Load the conversation with a group or person */ -WhatsAppWeb.prototype.loadConversation = query.loadConversation -/** Load the entire friggin conversation with a group or person */ -WhatsAppWeb.prototype.loadEntireConversation = query.loadEntireConversation -/** Get the metadata of the group */ -WhatsAppWeb.prototype.groupMetadata = query.groupMetadata -/** Create a group */ -WhatsAppWeb.prototype.groupCreate = query.groupCreate -/** Leave a group */ -WhatsAppWeb.prototype.groupLeave = query.groupLeave -/** Add somebody to the group */ -WhatsAppWeb.prototype.groupAdd = query.groupAdd -/** Remove somebody from the group */ -WhatsAppWeb.prototype.groupRemove = query.groupRemove -/** Make somebody admin on the group */ -WhatsAppWeb.prototype.groupMakeAdmin = query.groupMakeAdmin -/** Get the invite code of the group */ -WhatsAppWeb.prototype.groupInviteCode = query.groupInviteCode - - -module.exports = WhatsAppWeb diff --git a/binary_coding/.DS_Store b/binary_coding/.DS_Store deleted file mode 100644 index 73d41478af97836cc55313c80e23a9d60c2636de..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHK!A`?441L*l*uX6I(&!fY5|& zDSnA-JMK%=GyuZzd3ph40Qzi#odMMsBG09@q+^yIF{B)ic*PASs4#7LyWtQSkhMEO zfqSel#^?1D%Z#h}gc3D%jdMJpzFJh1Vo?>0%ieZ`w&R^#C9~*$D4G2y83x=tCGP0E zW<eWz3fGq3jKJ;e3$nw$Y=z!~@r26$$R z^p6x>I|I&uGq7Pmz7LU2FgI)z)2D+fT>*&l8<~WCxl2e)G|UYfMLwYf4JB%5uq#H; zaN48!<%W%-h9lVJBiPKrZYUwm&ipaCBjk#%odIWHn}MzlGdce+zrX))2l>bua0dPr z1EDv%9u4_QcDA-&PR`oMcFQIrevRTLgq?I0(^rn-Q??|uN9hoA!$y%7ivI{C8eBO8 Hf6Bl+K9hKR diff --git a/binary_coding/binary_coding_tests.js b/binary_coding/binary_coding_tests.js deleted file mode 100644 index e733ad4..0000000 --- a/binary_coding/binary_coding_tests.js +++ /dev/null @@ -1,25 +0,0 @@ -const assert = require('assert').strict -const BinaryCoding = require("./binary_encoder.js") - -const testingPairs = [ - [ - "f806092f5a0a10f804f80234fc6c0a350a1b39313735323938373131313740732e77686174736170702e6e657410011a143345423030393637354537454433374141424632122b0a292a7069616e6f20726f6f6d2074696d696e6773206172653a2a0a20363a3030414d2d31323a3030414d18b3faa7f3052003f80234fc4c0a410a1b39313735323938373131313740732e77686174736170702e6e657410001a20304643454335333330463634393239433645394132434646443242433845414418bdfaa7f305c00101f80234fc930a350a1b39313735323938373131313740732e77686174736170702e6e657410011a14334542303033433742353339414644303937353312520a50536f727279206672656e2c204920636f756c646e277420756e6465727374616e6420274c69627261272e2054797065202768656c702720746f206b6e6f77207768617420616c6c20492063616e20646f18c1faa7f3052003f80234fc540a410a1b39313735323938373131313740732e77686174736170702e6e657410001a20413132333042384436423041314437393345433241453245413043313638443812090a076c69627261727918c2faa7f305", - ["action",{"last":"true","add":"before"},[["message",null,{"key":{"remoteJid":"917529871117@s.whatsapp.net","fromMe":true,"id":"3EB009675E7ED37AABF2"},"message":{"conversation":"*piano room timings are:*\n 6:00AM-12:00AM"},"messageTimestamp":"1584004403","status":"DELIVERY_ACK"}],["message",null,{"key":{"remoteJid":"917529871117@s.whatsapp.net","fromMe":false,"id":"0FCEC5330F64929C6E9A2CFFD2BC8EAD"},"messageTimestamp":"1584004413","messageStubType":"REVOKE"}],["message",null,{"key":{"remoteJid":"917529871117@s.whatsapp.net","fromMe":true,"id":"3EB003C7B539AFD09753"},"message":{"conversation":"Sorry fren, I couldn't understand 'Libra'. Type 'help' to know what all I can do"},"messageTimestamp":"1584004417","status":"DELIVERY_ACK"}],["message",null,{"key":{"remoteJid":"917529871117@s.whatsapp.net","fromMe":false,"id":"A1230B8D6B0A1D793EC2AE2EA0C168D8"},"message":{"conversation":"library"},"messageTimestamp":"1584004418"}]]] - ] -] -function testCoding () { - const encoder = new BinaryCoding.Encoder() - const decoder = new BinaryCoding.Decoder() - - testingPairs.forEach(pair => { - const buff = Buffer.from(pair[0], 'hex') - const decoded = decoder.read(buff) - - assert.deepEqual( JSON.stringify( decoded ), JSON.stringify( pair[1] )) - - const encoded = encoder.write(decoded) - assert.deepEqual(encoded, buff) - }) - console.log("all coding tests passed") -} -testCoding() diff --git a/binary_coding/binary_encoder.js b/binary_coding/binary_encoder.js deleted file mode 100644 index 6dfe94f..0000000 --- a/binary_coding/binary_encoder.js +++ /dev/null @@ -1,476 +0,0 @@ -const ProtoBuf = require("protobufjs") - -const WATags = { - LIST_EMPTY: 0, - STREAM_END: 2, - DICTIONARY_0: 236, - DICTIONARY_1: 237, - DICTIONARY_2: 238, - DICTIONARY_3: 239, - LIST_8 : 248, - LIST_16 : 249, - JID_PAIR : 250, - HEX_8 : 251, - BINARY_8 : 252, - BINARY_20 : 253, - BINARY_32 : 254, - NIBBLE_8 : 255, - SINGLE_BYTE_MAX: 256, - PACKED_MAX: 254 -} -const WADoubleByteTokens = [] - -const WASingleByteTokens = [ - null,null,null,"200","400","404","500","501","502","action","add", - "after","archive","author","available","battery","before","body", - "broadcast","chat","clear","code","composing","contacts","count", - "create","debug","delete","demote","duplicate","encoding","error", - "false","filehash","from","g.us","group","groups_v2","height","id", - "image","in","index","invis","item","jid","kind","last","leave", - "live","log","media","message","mimetype","missing","modify","name", - "notification","notify","out","owner","participant","paused", - "picture","played","presence","preview","promote","query","raw", - "read","receipt","received","recipient","recording","relay", - "remove","response","resume","retry","s.whatsapp.net","seconds", - "set","size","status","subject","subscribe","t","text","to","true", - "type","unarchive","unavailable","url","user","value","web","width", - "mute","read_only","admin","creator","short","update","powersave", - "checksum","epoch","block","previous","409","replaced","reason", - "spam","modify_tag","message_info","delivery","emoji","title", - "description","canonical-url","matched-text","star","unstar", - "media_key","filename","identity","unread","page","page_count", - "search","media_message","security","call_log","profile","ciphertext", - "invite","gif","vcard","frequent","privacy","blacklist","whitelist", - "verify","location","document","elapsed","revoke_invite","expiration", - "unsubscribe","disable","vname","old_jid","new_jid","announcement", - "locked","prop","label","color","call","offer","call-id", - "quick_reply", "sticker", "pay_t", "accept", "reject", "sticker_pack", - "invalid", "canceled", "missed", "connected", "result", "audio", - "video", "recent" -] -const WebMessageInfo = ProtoBuf.Root.fromJSON( require("./whatsapp_message_coding.json") ).lookupType("proto.WebMessageInfo") - -class WhatsAppBinaryEncoder { - - constructor () { - this.data = [] - } - pushByte (value) { - - this.data.push((value & 0xFF)) - } - pushInt (value, n, littleEndian=false) { - for (var i = 0; i < n;i++) { - const curShift = littleEndian ? i : (n-1-i) - this.data.push( (value>>(curShift*8)) & 0xFF ) - } - } - pushInt20 (value) { - this.pushBytes ( [(value >> 16) & 0x0F, (value >> 8) & 0xFF, value & 0xFF] ) - } - pushInt16 (value) { - this.pushInt(value, 2) - } - pushInt32 (value) { - this.pushInt(value, 4) - } - pushInt64 (value) { - this.pushInt(value, 8) - } - pushBytes (bytes) { - this.data.push.apply(this.data, bytes) - } - pushString (str) { - const bytes = new TextEncoder('utf-8').encode(str) - this.pushBytes(bytes) - } - writeByteLength (length) { - if (length >= 4294967296) { - throw "string too large to encode: " + length - } - - if (length >= (1<<20)) { - this.pushByte(WATags.BINARY_32) - this.pushInt32(length) - } else if (length >= 256) { - this.pushByte(WATags.BINARY_20) - this.pushInt20(length) - } else { - this.pushByte(WATags.BINARY_8) - this.pushByte(length) - } - } - writeStringRaw (string) { - this.writeByteLength( string.length ) - this.pushString(string) - } - writeJid(left,right) { - this.pushByte(WATags.JID_PAIR) - if (left && left.length > 0) { - this.writeString(left) - } else { - this.writeToken(WATags.LIST_EMPTY) - } - this.writeString(right) - } - writeToken (token) { - if (token < 245) { - this.pushByte(token) - } else if (token <= 500) { - throw "invalid token" - } - } - writeString(token, i=null) { - if (typeof token !== "string") { - throw "invalid string: " + token - } - - if (token === "c.us") { - token = "s.whatsapp.net" - } - - - const tokenIndex = WASingleByteTokens.indexOf(token) - if (!i && token === "s.whatsapp.net") { - this.writeToken( tokenIndex ) - } else if ( tokenIndex >= 0 ) { - if (tokenIndex < WATags.SINGLE_BYTE_MAX) { - this.writeToken(tokenIndex) - } else { - const overflow = tokenIndex-WATags.SINGLE_BYTE_MAX - const dictionaryIndex = overflow >> 8 - if (dictionaryIndex < 0 || dictionaryIndex > 3) { - throw "double byte dict token out of range: " + token + ", " + tokenIndex - } - this.writeToken(WATags.DICTIONARY_0 + dictionaryIndex) - this.writeToken(overflow % 256) - } - } else { - const jidSepIndex = token.indexOf("@") - - if (jidSepIndex <= 0) { - this.writeStringRaw(token) - } else { - this.writeJid(token.slice(0,jidSepIndex), token.slice(jidSepIndex+1, token.length)) - } - } - } - writeAttributes (attrs) { - if (!attrs) { - return - } - Object.keys(attrs).forEach (key => { - this.writeString( key ) - this.writeString( attrs[key] ) - }) - } - writeListStart (listSize) { - if (listSize === 0) { - this.pushByte(WATags.LIST_EMPTY) - } else if (listSize < 256) { - this.pushBytes([WATags.LIST_8, listSize]) - } else { - this.pushByte([WATags.LIST_16, listSize]) - } - } - writeChildren (children) { - if (!children) { - return - } - - if (typeof children === "string") { - this.writeString(children, true) - } else if (typeof children === "Buffer" || typeof children === "Uint8Array") { - this.writeByteLength(children.length) - this.pushBytes(children) - } else if (Array.isArray(children)) { - this.writeListStart(children.length) - children.forEach (c => { - this.writeNode(c) - }) - } else if (typeof children === "object") { - //console.log(children) - const buff = WebMessageInfo.encode(children).finish() - this.writeByteLength(buff.length) - this.pushBytes(buff) - } else { - throw "invalid children: " + children + " (" + (typeof children) + ")" - } - } - getNumValidKeys (arr) { - return arr ? Object.keys(arr).length : 0 - } - writeNode (node) { - if (!node) { - return - } else if (!Array.isArray(node) || node.length !== 3) { - throw "invalid node given: " + node - } - - const numAttributes = this.getNumValidKeys(node[1]) - - this.writeListStart( 2*numAttributes + 1 + ( node[2] ? 1 : 0 ) ) - this.writeString(node[0]) - this.writeAttributes(node[1]) - this.writeChildren(node[2]) - } - write (data) { - this.data = new Array() - this.writeNode(data) - - return Buffer.from(this.data) - } -} -class WhatsAppBinaryDecoder { - - constructor () { - this.buffer = null - this.index = 0 - - } - checkEOS (length) { - if (this.index+length > this.buffer.length) { - throw "end of stream" - } - } - next () { - const value = this.buffer[this.index] - this.index += 1 - return value - } - readByte () { - this.checkEOS(1) - return this.next() - } - - readInt (n, littleEndian=false) { - this.checkEOS(n) - let val = 0 - for (var i = 0; i < n;i++) { - const shift = (littleEndian) ? i : (n-1-i) - val |= this.next() << (shift*8) - } - return val - } - readInt16 (littleEndian=false) { - return this.readInt(2, littleEndian) - } - readInt20 () { - this.checkEOS(3) - return ( (this.next() & 15) << 16 ) + (this.next()<<8) + this.next() - } - readInt32 (littleEndian=false) { - return this.readInt(4, littleEndian) - } - readInt64 (littleEndian=false) { - return this.readInt(8, littleEndian) - } - unpackHex (value) { - if (value >= 0 && value < 16) { - return value<10 ? ('0'.charCodeAt(0)+value) : ('A'.charCodeAt(0)+value-10) - } - throw "invalid hex: " + value - } - unpackNibble(value) { - if (value >= 0 && value <= 9) { - return '0'.charCodeAt(0)+value - } - switch (value) { - case 10: - return '-'.charCodeAt(0) - case 11: - return '.'.charCodeAt(0) - case 15: - return '\0'.charCodeAt(0) - default: - throw "invalid nibble: " + value - } - } - unpackByte (tag, value) { - if (tag === WATags.NIBBLE_8) { - return this.unpackNibble(value) - } else if (tag === WATags.HEX_8) { - return this.unpackHex(value) - } else { - throw "unknown tag: " + tag - } - } - readPacked8(tag) { - const startByte = this.readByte() - let value = "" - - for (var i = 0; i < (startByte&127);i++) { - let curByte = this.readByte() - value += String.fromCharCode( this.unpackByte(tag, (curByte&0xF0) >> 4) ) - value += String.fromCharCode( this.unpackByte(tag, curByte&0x0F) ) - } - if ((startByte >> 7) !== 0) { - value = value.slice(0,-1) - } - return value - - } - readRangedVarInt (min, max, description="unknown") { - // value = - throw "WTF" - } - isListTag (tag) { - return tag === WATags.LIST_EMPTY || tag === WATags.LIST_8 || tag === WATags.LIST_16 - } - readListSize (tag) { - switch (tag) { - case WATags.LIST_EMPTY: - return 0 - case WATags.LIST_8: - return this.readByte() - case WATags.LIST_16: - return this.readInt16() - default: - throw "invalid tag for list size: " + tag - } - } - readStringFromChars (length) { - this.checkEOS(length) - const value = this.buffer.slice(this.index, this.index+length) - - this.index += length - return new TextDecoder('utf-8').decode(value) - } - readString (tag) { - if (tag >= 3 && tag <= 235) { - const token = this.getToken(tag) - return token === "s.whatsapp.net" ? "c.us" : token - } - - switch (tag) { - case WATags.DICTIONARY_0: - case WATags.DICTIONARY_1: - case WATags.DICTIONARY_2: - case WATags.DICTIONARY_3: - return this.getTokenDouble( tag - WATags.DICTIONARY_0, this.readByte() ) - case WATags.LIST_EMPTY: - return null - case WATags.BINARY_8: - return this.readStringFromChars( this.readByte() ) - case WATags.BINARY_20: - return this.readStringFromChars( this.readInt20() ) - case WATags.BINARY_32: - return this.readStringFromChars( this.readInt32() ) - case WATags.JID_PAIR: - const i = this.readString( this.readByte() ) - const j = this.readString( this.readByte() ) - if (i && j) { - return i + "@" + j - } - throw "invalid jid pair: " + i + ", " + j - case WATags.HEX_8: - case WATags.NIBBLE_8: - return this.readPacked8(tag) - default: - throw "invalid string with tag: " + tag - } - } - readAttributes (n) { - if (n !== 0) { - let attributes = {} - for (var i = 0;i < n;i++) { - const index = this.readString(this.readByte()) - const b = this.readByte() - - attributes[index] = this.readString(b) - } - return attributes - } else { - return null - } - } - readList (tag) { - let list = Array( this.readListSize(tag) ) - for (var i = 0;i < list.length;i++) { - list[i] = this.readNode() - } - return list - } - readBytes (n) { - this.checkEOS(n) - const value = this.buffer.slice(this.index, this.index+n) - this.index += n - return value - } - getToken (index) { - if (index < 3 || index >= WASingleByteTokens.length) { - throw "invalid token index: " + index - } - return WASingleByteTokens[index] - } - getTokenDouble (index1, index2) { - const n = 256*index1 + index2 - if (n < 0 || n > WADoubleByteTokens.length) { - throw "invalid double token index: " + n - } - return WADoubleByteTokens[n] - } - readNode () { - const listSize = this.readListSize( this.readByte() ) - const descrTag = this.readByte() - - if (descrTag === WATags.STREAM_END) { - throw "unexpected stream end" - } - - const descr = this.readString(descrTag) - if (listSize === 0 || !descr) { - throw "invalid node" - } - //console.log(descr + "," + listSize) - - let attrs = this.readAttributes( (listSize-1) >> 1 ) - let content = null - - - if (listSize%2 === 0) { - const tag = this.readByte() - - if (this.isListTag(tag)) { - content = this.readList(tag) - } else { - switch (tag) { - case WATags.BINARY_8: - content = this.readBytes( this.readByte() ) - break - case WATags.BINARY_20: - content = this.readBytes( this.readInt20() ) - break - case WATags.BINARY_32: - content = this.readBytes( this.readInt32() ) - break - default: - content = this.readString(tag) - break - } - } - } - //console.log( descr + "," + JSON.stringify(attrs) + ", " + content) - return [descr, attrs, content] - } - - read (buffer) { - this.buffer = buffer - this.index = 0 - - let node = this.readNode() - - if (node[2]) { - for (var i = 0; i < node[2].length;i++) { - if (node[2][0][0] === "message") { - node[2][i][2] = WebMessageInfo.decode( node[2][i][2] ) - } - } - } - - return node - } - -} - -module.exports = { Encoder: WhatsAppBinaryEncoder, Decoder: WhatsAppBinaryDecoder } \ No newline at end of file diff --git a/binary_coding/whatsapp_message_coding.json b/binary_coding/whatsapp_message_coding.json deleted file mode 100644 index de6f89a..0000000 --- a/binary_coding/whatsapp_message_coding.json +++ /dev/null @@ -1,1889 +0,0 @@ -{ - "nested": { - "proto": { - "nested": { - "HydratedQuickReplyButton": { - "fields": { - "displayText": { - "type": "string", - "id": 1 - }, - "id": { - "type": "string", - "id": 2 - } - } - }, - "HydratedURLButton": { - "fields": { - "displayText": { - "type": "string", - "id": 1 - }, - "url": { - "type": "string", - "id": 2 - } - } - }, - "HydratedCallButton": { - "fields": { - "displayText": { - "type": "string", - "id": 1 - }, - "phoneNumber": { - "type": "string", - "id": 2 - } - } - }, - "HydratedTemplateButton": { - "oneofs": { - "hydratedButton": { - "oneof": [ - "quickReplyButton", - "urlButton", - "callButton" - ] - } - }, - "fields": { - "index": { - "type": "uint32", - "id": 4 - }, - "quickReplyButton": { - "type": "HydratedQuickReplyButton", - "id": 1 - }, - "urlButton": { - "type": "HydratedURLButton", - "id": 2 - }, - "callButton": { - "type": "HydratedCallButton", - "id": 3 - } - } - }, - "QuickReplyButton": { - "fields": { - "displayText": { - "type": "HighlyStructuredMessage", - "id": 1 - }, - "id": { - "type": "string", - "id": 2 - } - } - }, - "URLButton": { - "fields": { - "displayText": { - "type": "HighlyStructuredMessage", - "id": 1 - }, - "url": { - "type": "HighlyStructuredMessage", - "id": 2 - } - } - }, - "CallButton": { - "fields": { - "displayText": { - "type": "HighlyStructuredMessage", - "id": 1 - }, - "phoneNumber": { - "type": "HighlyStructuredMessage", - "id": 2 - } - } - }, - "TemplateButton": { - "oneofs": { - "button": { - "oneof": [ - "quickReplyButton", - "urlButton", - "callButton" - ] - } - }, - "fields": { - "index": { - "type": "uint32", - "id": 4 - }, - "quickReplyButton": { - "type": "QuickReplyButton", - "id": 1 - }, - "urlButton": { - "type": "URLButton", - "id": 2 - }, - "callButton": { - "type": "CallButton", - "id": 3 - } - } - }, - "Location": { - "fields": { - "degreesLatitude": { - "type": "double", - "id": 1 - }, - "degreesLongitude": { - "type": "double", - "id": 2 - }, - "name": { - "type": "string", - "id": 3 - } - } - }, - "Point": { - "fields": { - "x": { - "type": "double", - "id": 3 - }, - "y": { - "type": "double", - "id": 4 - } - } - }, - "InteractiveAnnotation": { - "oneofs": { - "action": { - "oneof": [ - "location" - ] - } - }, - "fields": { - "polygonVertices": { - "rule": "repeated", - "type": "Point", - "id": 1 - }, - "location": { - "type": "Location", - "id": 2 - } - } - }, - "AdReplyInfo": { - "fields": { - "advertiserName": { - "type": "string", - "id": 1 - }, - "mediaType": { - "type": "AD_REPLY_INFO_MEDIATYPE", - "id": 2 - }, - "jpegThumbnail": { - "type": "bytes", - "id": 16 - }, - "caption": { - "type": "string", - "id": 17 - } - }, - "nested": { - "AD_REPLY_INFO_MEDIATYPE": { - "values": { - "NONE": 0, - "IMAGE": 1, - "VIDEO": 2 - } - } - } - }, - "ContextInfo": { - "fields": { - "stanzaId": { - "type": "string", - "id": 1 - }, - "participant": { - "type": "string", - "id": 2 - }, - "quotedMessage": { - "type": "Message", - "id": 3 - }, - "remoteJid": { - "type": "string", - "id": 4 - }, - "mentionedJid": { - "rule": "repeated", - "type": "string", - "id": 15 - }, - "conversionSource": { - "type": "string", - "id": 18 - }, - "conversionData": { - "type": "bytes", - "id": 19 - }, - "conversionDelaySeconds": { - "type": "uint32", - "id": 20 - }, - "forwardingScore": { - "type": "uint32", - "id": 21 - }, - "isForwarded": { - "type": "bool", - "id": 22 - }, - "quotedAd": { - "type": "AdReplyInfo", - "id": 23 - }, - "placeholderKey": { - "type": "MessageKey", - "id": 24 - }, - "expiration": { - "type": "uint32", - "id": 25 - } - } - }, - "SenderKeyDistributionMessage": { - "fields": { - "groupId": { - "type": "string", - "id": 1 - }, - "axolotlSenderKeyDistributionMessage": { - "type": "bytes", - "id": 2 - } - } - }, - "ImageMessage": { - "fields": { - "url": { - "type": "string", - "id": 1 - }, - "mimetype": { - "type": "string", - "id": 2 - }, - "caption": { - "type": "string", - "id": 3 - }, - "fileSha256": { - "type": "bytes", - "id": 4 - }, - "fileLength": { - "type": "uint64", - "id": 5 - }, - "height": { - "type": "uint32", - "id": 6 - }, - "width": { - "type": "uint32", - "id": 7 - }, - "mediaKey": { - "type": "bytes", - "id": 8 - }, - "fileEncSha256": { - "type": "bytes", - "id": 9 - }, - "interactiveAnnotations": { - "rule": "repeated", - "type": "InteractiveAnnotation", - "id": 10 - }, - "directPath": { - "type": "string", - "id": 11 - }, - "mediaKeyTimestamp": { - "type": "int64", - "id": 12 - }, - "jpegThumbnail": { - "type": "bytes", - "id": 16 - }, - "contextInfo": { - "type": "ContextInfo", - "id": 17 - }, - "firstScanSidecar": { - "type": "bytes", - "id": 18 - }, - "firstScanLength": { - "type": "uint32", - "id": 19 - }, - "experimentGroupId": { - "type": "uint32", - "id": 20 - }, - "scansSidecar": { - "type": "bytes", - "id": 21 - }, - "scanLengths": { - "rule": "repeated", - "type": "uint32", - "id": 22, - "options": { - "packed": false - } - }, - "midQualityFileSha256": { - "type": "bytes", - "id": 23 - }, - "midQualityFileEncSha256": { - "type": "bytes", - "id": 24 - } - } - }, - "ContactMessage": { - "fields": { - "displayName": { - "type": "string", - "id": 1 - }, - "vcard": { - "type": "string", - "id": 16 - }, - "contextInfo": { - "type": "ContextInfo", - "id": 17 - } - } - }, - "LocationMessage": { - "fields": { - "degreesLatitude": { - "type": "double", - "id": 1 - }, - "degreesLongitude": { - "type": "double", - "id": 2 - }, - "name": { - "type": "string", - "id": 3 - }, - "address": { - "type": "string", - "id": 4 - }, - "url": { - "type": "string", - "id": 5 - }, - "jpegThumbnail": { - "type": "bytes", - "id": 16 - }, - "contextInfo": { - "type": "ContextInfo", - "id": 17 - } - } - }, - "ExtendedTextMessage": { - "fields": { - "text": { - "type": "string", - "id": 1 - }, - "matchedText": { - "type": "string", - "id": 2 - }, - "canonicalUrl": { - "type": "string", - "id": 4 - }, - "description": { - "type": "string", - "id": 5 - }, - "title": { - "type": "string", - "id": 6 - }, - "textArgb": { - "type": "fixed32", - "id": 7 - }, - "backgroundArgb": { - "type": "fixed32", - "id": 8 - }, - "font": { - "type": "EXTENDED_TEXT_MESSAGE_FONTTYPE", - "id": 9 - }, - "previewType": { - "type": "EXTENDED_TEXT_MESSAGE_PREVIEWTYPE", - "id": 10 - }, - "jpegThumbnail": { - "type": "bytes", - "id": 16 - }, - "contextInfo": { - "type": "ContextInfo", - "id": 17 - }, - "doNotPlayInline": { - "type": "bool", - "id": 18 - } - }, - "nested": { - "EXTENDED_TEXT_MESSAGE_FONTTYPE": { - "values": { - "SANS_SERIF": 0, - "SERIF": 1, - "NORICAN_REGULAR": 2, - "BRYNDAN_WRITE": 3, - "BEBASNEUE_REGULAR": 4, - "OSWALD_HEAVY": 5 - } - }, - "EXTENDED_TEXT_MESSAGE_PREVIEWTYPE": { - "values": { - "NONE": 0, - "VIDEO": 1 - } - } - } - }, - "DocumentMessage": { - "fields": { - "url": { - "type": "string", - "id": 1 - }, - "mimetype": { - "type": "string", - "id": 2 - }, - "title": { - "type": "string", - "id": 3 - }, - "fileSha256": { - "type": "bytes", - "id": 4 - }, - "fileLength": { - "type": "uint64", - "id": 5 - }, - "pageCount": { - "type": "uint32", - "id": 6 - }, - "mediaKey": { - "type": "bytes", - "id": 7 - }, - "fileName": { - "type": "string", - "id": 8 - }, - "fileEncSha256": { - "type": "bytes", - "id": 9 - }, - "directPath": { - "type": "string", - "id": 10 - }, - "mediaKeyTimestamp": { - "type": "int64", - "id": 11 - }, - "jpegThumbnail": { - "type": "bytes", - "id": 16 - }, - "contextInfo": { - "type": "ContextInfo", - "id": 17 - } - } - }, - "AudioMessage": { - "fields": { - "url": { - "type": "string", - "id": 1 - }, - "mimetype": { - "type": "string", - "id": 2 - }, - "fileSha256": { - "type": "bytes", - "id": 3 - }, - "fileLength": { - "type": "uint64", - "id": 4 - }, - "seconds": { - "type": "uint32", - "id": 5 - }, - "ptt": { - "type": "bool", - "id": 6 - }, - "mediaKey": { - "type": "bytes", - "id": 7 - }, - "fileEncSha256": { - "type": "bytes", - "id": 8 - }, - "directPath": { - "type": "string", - "id": 9 - }, - "mediaKeyTimestamp": { - "type": "int64", - "id": 10 - }, - "contextInfo": { - "type": "ContextInfo", - "id": 17 - }, - "streamingSidecar": { - "type": "bytes", - "id": 18 - } - } - }, - "VideoMessage": { - "fields": { - "url": { - "type": "string", - "id": 1 - }, - "mimetype": { - "type": "string", - "id": 2 - }, - "fileSha256": { - "type": "bytes", - "id": 3 - }, - "fileLength": { - "type": "uint64", - "id": 4 - }, - "seconds": { - "type": "uint32", - "id": 5 - }, - "mediaKey": { - "type": "bytes", - "id": 6 - }, - "caption": { - "type": "string", - "id": 7 - }, - "gifPlayback": { - "type": "bool", - "id": 8 - }, - "height": { - "type": "uint32", - "id": 9 - }, - "width": { - "type": "uint32", - "id": 10 - }, - "fileEncSha256": { - "type": "bytes", - "id": 11 - }, - "interactiveAnnotations": { - "rule": "repeated", - "type": "InteractiveAnnotation", - "id": 12 - }, - "directPath": { - "type": "string", - "id": 13 - }, - "mediaKeyTimestamp": { - "type": "int64", - "id": 14 - }, - "jpegThumbnail": { - "type": "bytes", - "id": 16 - }, - "contextInfo": { - "type": "ContextInfo", - "id": 17 - }, - "streamingSidecar": { - "type": "bytes", - "id": 18 - }, - "gifAttribution": { - "type": "VIDEO_MESSAGE_ATTRIBUTION", - "id": 19 - } - }, - "nested": { - "VIDEO_MESSAGE_ATTRIBUTION": { - "values": { - "NONE": 0, - "GIPHY": 1, - "TENOR": 2 - } - } - } - }, - "Call": { - "fields": { - "callKey": { - "type": "bytes", - "id": 1 - } - } - }, - "Chat": { - "fields": { - "displayName": { - "type": "string", - "id": 1 - }, - "id": { - "type": "string", - "id": 2 - } - } - }, - "ProtocolMessage": { - "fields": { - "key": { - "type": "MessageKey", - "id": 1 - }, - "type": { - "type": "PROTOCOL_MESSAGE_TYPE", - "id": 2 - }, - "ephemeralExpiration": { - "type": "uint32", - "id": 4 - } - }, - "nested": { - "PROTOCOL_MESSAGE_TYPE": { - "values": { - "REVOKE": 0, - "EPHEMERAL_SETTING": 3 - } - } - } - }, - "ContactsArrayMessage": { - "fields": { - "displayName": { - "type": "string", - "id": 1 - }, - "contacts": { - "rule": "repeated", - "type": "ContactMessage", - "id": 2 - }, - "contextInfo": { - "type": "ContextInfo", - "id": 17 - } - } - }, - "HSMCurrency": { - "fields": { - "currencyCode": { - "type": "string", - "id": 1 - }, - "amount1000": { - "type": "int64", - "id": 2 - } - } - }, - "HSMDateTimeComponent": { - "fields": { - "dayOfWeek": { - "type": "HSM_DATE_TIME_COMPONENT_DAYOFWEEKTYPE", - "id": 1 - }, - "year": { - "type": "uint32", - "id": 2 - }, - "month": { - "type": "uint32", - "id": 3 - }, - "dayOfMonth": { - "type": "uint32", - "id": 4 - }, - "hour": { - "type": "uint32", - "id": 5 - }, - "minute": { - "type": "uint32", - "id": 6 - }, - "calendar": { - "type": "HSM_DATE_TIME_COMPONENT_CALENDARTYPE", - "id": 7 - } - }, - "nested": { - "HSM_DATE_TIME_COMPONENT_DAYOFWEEKTYPE": { - "values": { - "MONDAY": 1, - "TUESDAY": 2, - "WEDNESDAY": 3, - "THURSDAY": 4, - "FRIDAY": 5, - "SATURDAY": 6, - "SUNDAY": 7 - } - }, - "HSM_DATE_TIME_COMPONENT_CALENDARTYPE": { - "values": { - "GREGORIAN": 1, - "SOLAR_HIJRI": 2 - } - } - } - }, - "HSMDateTimeUnixEpoch": { - "fields": { - "timestamp": { - "type": "int64", - "id": 1 - } - } - }, - "HSMDateTime": { - "oneofs": { - "datetimeOneof": { - "oneof": [ - "component", - "unixEpoch" - ] - } - }, - "fields": { - "component": { - "type": "HSMDateTimeComponent", - "id": 1 - }, - "unixEpoch": { - "type": "HSMDateTimeUnixEpoch", - "id": 2 - } - } - }, - "HSMLocalizableParameter": { - "oneofs": { - "paramOneof": { - "oneof": [ - "currency", - "dateTime" - ] - } - }, - "fields": { - "default": { - "type": "string", - "id": 1 - }, - "currency": { - "type": "HSMCurrency", - "id": 2 - }, - "dateTime": { - "type": "HSMDateTime", - "id": 3 - } - } - }, - "HighlyStructuredMessage": { - "fields": { - "namespace": { - "type": "string", - "id": 1 - }, - "elementName": { - "type": "string", - "id": 2 - }, - "params": { - "rule": "repeated", - "type": "string", - "id": 3 - }, - "fallbackLg": { - "type": "string", - "id": 4 - }, - "fallbackLc": { - "type": "string", - "id": 5 - }, - "localizableParams": { - "rule": "repeated", - "type": "HSMLocalizableParameter", - "id": 6 - }, - "deterministicLg": { - "type": "string", - "id": 7 - }, - "deterministicLc": { - "type": "string", - "id": 8 - }, - "hydratedHsm": { - "type": "TemplateMessage", - "id": 9 - } - } - }, - "SendPaymentMessage": { - "fields": { - "noteMessage": { - "type": "Message", - "id": 2 - }, - "requestMessageKey": { - "type": "MessageKey", - "id": 3 - } - } - }, - "RequestPaymentMessage": { - "fields": { - "noteMessage": { - "type": "Message", - "id": 4 - }, - "currencyCodeIso4217": { - "type": "string", - "id": 1 - }, - "amount1000": { - "type": "uint64", - "id": 2 - }, - "requestFrom": { - "type": "string", - "id": 3 - }, - "expiryTimestamp": { - "type": "int64", - "id": 5 - } - } - }, - "DeclinePaymentRequestMessage": { - "fields": { - "key": { - "type": "MessageKey", - "id": 1 - } - } - }, - "CancelPaymentRequestMessage": { - "fields": { - "key": { - "type": "MessageKey", - "id": 1 - } - } - }, - "LiveLocationMessage": { - "fields": { - "degreesLatitude": { - "type": "double", - "id": 1 - }, - "degreesLongitude": { - "type": "double", - "id": 2 - }, - "accuracyInMeters": { - "type": "uint32", - "id": 3 - }, - "speedInMps": { - "type": "float", - "id": 4 - }, - "degreesClockwiseFromMagneticNorth": { - "type": "uint32", - "id": 5 - }, - "caption": { - "type": "string", - "id": 6 - }, - "sequenceNumber": { - "type": "int64", - "id": 7 - }, - "timeOffset": { - "type": "uint32", - "id": 8 - }, - "jpegThumbnail": { - "type": "bytes", - "id": 16 - }, - "contextInfo": { - "type": "ContextInfo", - "id": 17 - } - } - }, - "StickerMessage": { - "fields": { - "url": { - "type": "string", - "id": 1 - }, - "fileSha256": { - "type": "bytes", - "id": 2 - }, - "fileEncSha256": { - "type": "bytes", - "id": 3 - }, - "mediaKey": { - "type": "bytes", - "id": 4 - }, - "mimetype": { - "type": "string", - "id": 5 - }, - "height": { - "type": "uint32", - "id": 6 - }, - "width": { - "type": "uint32", - "id": 7 - }, - "directPath": { - "type": "string", - "id": 8 - }, - "fileLength": { - "type": "uint64", - "id": 9 - }, - "mediaKeyTimestamp": { - "type": "int64", - "id": 10 - }, - "firstFrameLength": { - "type": "uint32", - "id": 11 - }, - "firstFrameSidecar": { - "type": "bytes", - "id": 12 - }, - "contextInfo": { - "type": "ContextInfo", - "id": 17 - } - } - }, - "FourRowTemplate": { - "oneofs": { - "title": { - "oneof": [ - "documentMessage", - "highlyStructuredMessage", - "imageMessage", - "videoMessage", - "locationMessage" - ] - } - }, - "fields": { - "content": { - "type": "HighlyStructuredMessage", - "id": 6 - }, - "footer": { - "type": "HighlyStructuredMessage", - "id": 7 - }, - "buttons": { - "rule": "repeated", - "type": "TemplateButton", - "id": 8 - }, - "documentMessage": { - "type": "DocumentMessage", - "id": 1 - }, - "highlyStructuredMessage": { - "type": "HighlyStructuredMessage", - "id": 2 - }, - "imageMessage": { - "type": "ImageMessage", - "id": 3 - }, - "videoMessage": { - "type": "VideoMessage", - "id": 4 - }, - "locationMessage": { - "type": "LocationMessage", - "id": 5 - } - } - }, - "HydratedFourRowTemplate": { - "oneofs": { - "title": { - "oneof": [ - "documentMessage", - "hydratedTitleText", - "imageMessage", - "videoMessage", - "locationMessage" - ] - } - }, - "fields": { - "hydratedContentText": { - "type": "string", - "id": 6 - }, - "hydratedFooterText": { - "type": "string", - "id": 7 - }, - "hydratedButtons": { - "rule": "repeated", - "type": "HydratedTemplateButton", - "id": 8 - }, - "templateId": { - "type": "string", - "id": 9 - }, - "documentMessage": { - "type": "DocumentMessage", - "id": 1 - }, - "hydratedTitleText": { - "type": "string", - "id": 2 - }, - "imageMessage": { - "type": "ImageMessage", - "id": 3 - }, - "videoMessage": { - "type": "VideoMessage", - "id": 4 - }, - "locationMessage": { - "type": "LocationMessage", - "id": 5 - } - } - }, - "TemplateMessage": { - "oneofs": { - "format": { - "oneof": [ - "fourRowTemplate", - "hydratedFourRowTemplate" - ] - } - }, - "fields": { - "contextInfo": { - "type": "ContextInfo", - "id": 3 - }, - "hydratedTemplate": { - "type": "HydratedFourRowTemplate", - "id": 4 - }, - "fourRowTemplate": { - "type": "FourRowTemplate", - "id": 1 - }, - "hydratedFourRowTemplate": { - "type": "HydratedFourRowTemplate", - "id": 2 - } - } - }, - "TemplateButtonReplyMessage": { - "fields": { - "selectedId": { - "type": "string", - "id": 1 - }, - "selectedDisplayText": { - "type": "string", - "id": 2 - }, - "contextInfo": { - "type": "ContextInfo", - "id": 3 - }, - "selectedIndex": { - "type": "uint32", - "id": 4 - } - } - }, - "ProductSnapshot": { - "fields": { - "productImage": { - "type": "ImageMessage", - "id": 1 - }, - "productId": { - "type": "string", - "id": 2 - }, - "title": { - "type": "string", - "id": 3 - }, - "description": { - "type": "string", - "id": 4 - }, - "currencyCode": { - "type": "string", - "id": 5 - }, - "priceAmount1000": { - "type": "int64", - "id": 6 - }, - "retailerId": { - "type": "string", - "id": 7 - }, - "url": { - "type": "string", - "id": 8 - }, - "productImageCount": { - "type": "uint32", - "id": 9 - }, - "firstImageId": { - "type": "string", - "id": 11 - } - } - }, - "ProductMessage": { - "fields": { - "product": { - "type": "ProductSnapshot", - "id": 1 - }, - "businessOwnerJid": { - "type": "string", - "id": 2 - }, - "contextInfo": { - "type": "ContextInfo", - "id": 17 - } - } - }, - "GroupInviteMessage": { - "fields": { - "groupJid": { - "type": "string", - "id": 1 - }, - "inviteCode": { - "type": "string", - "id": 2 - }, - "inviteExpiration": { - "type": "int64", - "id": 3 - }, - "groupName": { - "type": "string", - "id": 4 - }, - "jpegThumbnail": { - "type": "bytes", - "id": 5 - }, - "caption": { - "type": "string", - "id": 6 - }, - "contextInfo": { - "type": "ContextInfo", - "id": 7 - } - } - }, - "DeviceSentMessage": { - "fields": { - "destinationJid": { - "type": "string", - "id": 1 - }, - "message": { - "type": "Message", - "id": 2 - } - } - }, - "DeviceSyncMessage": { - "fields": { - "serializedXmlBytes": { - "type": "bytes", - "id": 1 - } - } - }, - "Message": { - "fields": { - "conversation": { - "type": "string", - "id": 1 - }, - "senderKeyDistributionMessage": { - "type": "SenderKeyDistributionMessage", - "id": 2 - }, - "imageMessage": { - "type": "ImageMessage", - "id": 3 - }, - "contactMessage": { - "type": "ContactMessage", - "id": 4 - }, - "locationMessage": { - "type": "LocationMessage", - "id": 5 - }, - "extendedTextMessage": { - "type": "ExtendedTextMessage", - "id": 6 - }, - "documentMessage": { - "type": "DocumentMessage", - "id": 7 - }, - "audioMessage": { - "type": "AudioMessage", - "id": 8 - }, - "videoMessage": { - "type": "VideoMessage", - "id": 9 - }, - "call": { - "type": "Call", - "id": 10 - }, - "chat": { - "type": "Chat", - "id": 11 - }, - "protocolMessage": { - "type": "ProtocolMessage", - "id": 12 - }, - "contactsArrayMessage": { - "type": "ContactsArrayMessage", - "id": 13 - }, - "highlyStructuredMessage": { - "type": "HighlyStructuredMessage", - "id": 14 - }, - "fastRatchetKeySenderKeyDistributionMessage": { - "type": "SenderKeyDistributionMessage", - "id": 15 - }, - "sendPaymentMessage": { - "type": "SendPaymentMessage", - "id": 16 - }, - "liveLocationMessage": { - "type": "LiveLocationMessage", - "id": 18 - }, - "requestPaymentMessage": { - "type": "RequestPaymentMessage", - "id": 22 - }, - "declinePaymentRequestMessage": { - "type": "DeclinePaymentRequestMessage", - "id": 23 - }, - "cancelPaymentRequestMessage": { - "type": "CancelPaymentRequestMessage", - "id": 24 - }, - "templateMessage": { - "type": "TemplateMessage", - "id": 25 - }, - "stickerMessage": { - "type": "StickerMessage", - "id": 26 - }, - "groupInviteMessage": { - "type": "GroupInviteMessage", - "id": 28 - }, - "templateButtonReplyMessage": { - "type": "TemplateButtonReplyMessage", - "id": 29 - }, - "productMessage": { - "type": "ProductMessage", - "id": 30 - }, - "deviceSentMessage": { - "type": "DeviceSentMessage", - "id": 31 - }, - "deviceSyncMessage": { - "type": "DeviceSyncMessage", - "id": 32 - } - } - }, - "MessageKey": { - "fields": { - "remoteJid": { - "type": "string", - "id": 1 - }, - "fromMe": { - "type": "bool", - "id": 2 - }, - "id": { - "type": "string", - "id": 3 - }, - "participant": { - "type": "string", - "id": 4 - } - } - }, - "WebFeatures": { - "fields": { - "labelsDisplay": { - "type": "WEB_FEATURES_FLAG", - "id": 1 - }, - "voipIndividualOutgoing": { - "type": "WEB_FEATURES_FLAG", - "id": 2 - }, - "groupsV3": { - "type": "WEB_FEATURES_FLAG", - "id": 3 - }, - "groupsV3Create": { - "type": "WEB_FEATURES_FLAG", - "id": 4 - }, - "changeNumberV2": { - "type": "WEB_FEATURES_FLAG", - "id": 5 - }, - "queryStatusV3Thumbnail": { - "type": "WEB_FEATURES_FLAG", - "id": 6 - }, - "liveLocations": { - "type": "WEB_FEATURES_FLAG", - "id": 7 - }, - "queryVname": { - "type": "WEB_FEATURES_FLAG", - "id": 8 - }, - "voipIndividualIncoming": { - "type": "WEB_FEATURES_FLAG", - "id": 9 - }, - "quickRepliesQuery": { - "type": "WEB_FEATURES_FLAG", - "id": 10 - }, - "payments": { - "type": "WEB_FEATURES_FLAG", - "id": 11 - }, - "stickerPackQuery": { - "type": "WEB_FEATURES_FLAG", - "id": 12 - }, - "liveLocationsFinal": { - "type": "WEB_FEATURES_FLAG", - "id": 13 - }, - "labelsEdit": { - "type": "WEB_FEATURES_FLAG", - "id": 14 - }, - "mediaUpload": { - "type": "WEB_FEATURES_FLAG", - "id": 15 - }, - "mediaUploadRichQuickReplies": { - "type": "WEB_FEATURES_FLAG", - "id": 18 - }, - "vnameV2": { - "type": "WEB_FEATURES_FLAG", - "id": 19 - }, - "videoPlaybackUrl": { - "type": "WEB_FEATURES_FLAG", - "id": 20 - }, - "statusRanking": { - "type": "WEB_FEATURES_FLAG", - "id": 21 - }, - "voipIndividualVideo": { - "type": "WEB_FEATURES_FLAG", - "id": 22 - }, - "thirdPartyStickers": { - "type": "WEB_FEATURES_FLAG", - "id": 23 - }, - "frequentlyForwardedSetting": { - "type": "WEB_FEATURES_FLAG", - "id": 24 - }, - "groupsV4JoinPermission": { - "type": "WEB_FEATURES_FLAG", - "id": 25 - }, - "recentStickers": { - "type": "WEB_FEATURES_FLAG", - "id": 26 - }, - "catalog": { - "type": "WEB_FEATURES_FLAG", - "id": 27 - }, - "starredStickers": { - "type": "WEB_FEATURES_FLAG", - "id": 28 - }, - "voipGroupCall": { - "type": "WEB_FEATURES_FLAG", - "id": 29 - }, - "templateMessage": { - "type": "WEB_FEATURES_FLAG", - "id": 30 - }, - "templateMessageInteractivity": { - "type": "WEB_FEATURES_FLAG", - "id": 31 - }, - "ephemeralMessages": { - "type": "WEB_FEATURES_FLAG", - "id": 32 - } - }, - "nested": { - "WEB_FEATURES_FLAG": { - "values": { - "NOT_STARTED": 0, - "FORCE_UPGRADE": 1, - "DEVELOPMENT": 2, - "PRODUCTION": 3 - } - } - } - }, - "TabletNotificationsInfo": { - "fields": { - "timestamp": { - "type": "uint64", - "id": 2 - }, - "unreadChats": { - "type": "uint32", - "id": 3 - }, - "notifyMessageCount": { - "type": "uint32", - "id": 4 - }, - "notifyMessage": { - "rule": "repeated", - "type": "NotificationMessageInfo", - "id": 5 - } - } - }, - "NotificationMessageInfo": { - "fields": { - "key": { - "type": "MessageKey", - "id": 1 - }, - "message": { - "type": "Message", - "id": 2 - }, - "messageTimestamp": { - "type": "uint64", - "id": 3 - }, - "participant": { - "type": "string", - "id": 4 - } - } - }, - "WebNotificationsInfo": { - "fields": { - "timestamp": { - "type": "uint64", - "id": 2 - }, - "unreadChats": { - "type": "uint32", - "id": 3 - }, - "notifyMessageCount": { - "type": "uint32", - "id": 4 - }, - "notifyMessages": { - "rule": "repeated", - "type": "WebMessageInfo", - "id": 5 - } - } - }, - "PaymentInfo": { - "fields": { - "amount1000": { - "type": "uint64", - "id": 2 - }, - "receiverJid": { - "type": "string", - "id": 3 - }, - "status": { - "type": "PAYMENT_INFO_STATUS", - "id": 4 - }, - "transactionTimestamp": { - "type": "uint64", - "id": 5 - }, - "requestMessageKey": { - "type": "MessageKey", - "id": 6 - }, - "expiryTimestamp": { - "type": "uint64", - "id": 7 - }, - "futureproofed": { - "type": "bool", - "id": 8 - }, - "currency": { - "type": "string", - "id": 9 - } - }, - "nested": { - "PAYMENT_INFO_STATUS": { - "values": { - "UNKNOWN_STATUS": 0, - "PROCESSING": 1, - "SENT": 2, - "NEED_TO_ACCEPT": 3, - "COMPLETE": 4, - "COULD_NOT_COMPLETE": 5, - "REFUNDED": 6, - "EXPIRED": 7, - "REJECTED": 8, - "CANCELLED": 9, - "WAITING_FOR_PAYER": 10, - "WAITING": 11 - } - } - } - }, - "WebMessageInfo": { - "fields": { - "key": { - "rule": "required", - "type": "MessageKey", - "id": 1 - }, - "message": { - "type": "Message", - "id": 2 - }, - "messageTimestamp": { - "type": "uint64", - "id": 3 - }, - "status": { - "type": "WEB_MESSAGE_INFO_STATUS", - "id": 4 - }, - "participant": { - "type": "string", - "id": 5 - }, - "ignore": { - "type": "bool", - "id": 16 - }, - "starred": { - "type": "bool", - "id": 17 - }, - "broadcast": { - "type": "bool", - "id": 18 - }, - "pushName": { - "type": "string", - "id": 19 - }, - "mediaCiphertextSha256": { - "type": "bytes", - "id": 20 - }, - "multicast": { - "type": "bool", - "id": 21 - }, - "urlText": { - "type": "bool", - "id": 22 - }, - "urlNumber": { - "type": "bool", - "id": 23 - }, - "messageStubType": { - "type": "WEB_MESSAGE_INFO_STUBTYPE", - "id": 24 - }, - "clearMedia": { - "type": "bool", - "id": 25 - }, - "messageStubParameters": { - "rule": "repeated", - "type": "string", - "id": 26 - }, - "duration": { - "type": "uint32", - "id": 27 - }, - "labels": { - "rule": "repeated", - "type": "string", - "id": 28 - }, - "paymentInfo": { - "type": "PaymentInfo", - "id": 29 - }, - "finalLiveLocation": { - "type": "LiveLocationMessage", - "id": 30 - }, - "quotedPaymentInfo": { - "type": "PaymentInfo", - "id": 31 - }, - "ephemeralStartTimestamp": { - "type": "uint64", - "id": 32 - }, - "ephemeralDuration": { - "type": "uint32", - "id": 33 - } - }, - "nested": { - "WEB_MESSAGE_INFO_STATUS": { - "values": { - "ERROR": 0, - "PENDING": 1, - "SERVER_ACK": 2, - "DELIVERY_ACK": 3, - "READ": 4, - "PLAYED": 5 - } - }, - "WEB_MESSAGE_INFO_STUBTYPE": { - "values": { - "UNKNOWN": 0, - "REVOKE": 1, - "CIPHERTEXT": 2, - "FUTUREPROOF": 3, - "NON_VERIFIED_TRANSITION": 4, - "UNVERIFIED_TRANSITION": 5, - "VERIFIED_TRANSITION": 6, - "VERIFIED_LOW_UNKNOWN": 7, - "VERIFIED_HIGH": 8, - "VERIFIED_INITIAL_UNKNOWN": 9, - "VERIFIED_INITIAL_LOW": 10, - "VERIFIED_INITIAL_HIGH": 11, - "VERIFIED_TRANSITION_ANY_TO_NONE": 12, - "VERIFIED_TRANSITION_ANY_TO_HIGH": 13, - "VERIFIED_TRANSITION_HIGH_TO_LOW": 14, - "VERIFIED_TRANSITION_HIGH_TO_UNKNOWN": 15, - "VERIFIED_TRANSITION_UNKNOWN_TO_LOW": 16, - "VERIFIED_TRANSITION_LOW_TO_UNKNOWN": 17, - "VERIFIED_TRANSITION_NONE_TO_LOW": 18, - "VERIFIED_TRANSITION_NONE_TO_UNKNOWN": 19, - "GROUP_CREATE": 20, - "GROUP_CHANGE_SUBJECT": 21, - "GROUP_CHANGE_ICON": 22, - "GROUP_CHANGE_INVITE_LINK": 23, - "GROUP_CHANGE_DESCRIPTION": 24, - "GROUP_CHANGE_RESTRICT": 25, - "GROUP_CHANGE_ANNOUNCE": 26, - "GROUP_PARTICIPANT_ADD": 27, - "GROUP_PARTICIPANT_REMOVE": 28, - "GROUP_PARTICIPANT_PROMOTE": 29, - "GROUP_PARTICIPANT_DEMOTE": 30, - "GROUP_PARTICIPANT_INVITE": 31, - "GROUP_PARTICIPANT_LEAVE": 32, - "GROUP_PARTICIPANT_CHANGE_NUMBER": 33, - "BROADCAST_CREATE": 34, - "BROADCAST_ADD": 35, - "BROADCAST_REMOVE": 36, - "GENERIC_NOTIFICATION": 37, - "E2E_IDENTITY_CHANGED": 38, - "E2E_ENCRYPTED": 39, - "CALL_MISSED_VOICE": 40, - "CALL_MISSED_VIDEO": 41, - "INDIVIDUAL_CHANGE_NUMBER": 42, - "GROUP_DELETE": 43, - "GROUP_ANNOUNCE_MODE_MESSAGE_BOUNCE": 44, - "CALL_MISSED_GROUP_VOICE": 45, - "CALL_MISSED_GROUP_VIDEO": 46, - "PAYMENT_CIPHERTEXT": 47, - "PAYMENT_FUTUREPROOF": 48, - "PAYMENT_TRANSACTION_STATUS_UPDATE_FAILED": 49, - "PAYMENT_TRANSACTION_STATUS_UPDATE_REFUNDED": 50, - "PAYMENT_TRANSACTION_STATUS_UPDATE_REFUND_FAILED": 51, - "PAYMENT_TRANSACTION_STATUS_RECEIVER_PENDING_SETUP": 52, - "PAYMENT_TRANSACTION_STATUS_RECEIVER_SUCCESS_AFTER_HICCUP": 53, - "PAYMENT_ACTION_ACCOUNT_SETUP_REMINDER": 54, - "PAYMENT_ACTION_SEND_PAYMENT_REMINDER": 55, - "PAYMENT_ACTION_SEND_PAYMENT_INVITATION": 56, - "PAYMENT_ACTION_REQUEST_DECLINED": 57, - "PAYMENT_ACTION_REQUEST_EXPIRED": 58, - "PAYMENT_ACTION_REQUEST_CANCELLED": 59, - "BIZ_VERIFIED_TRANSITION_TOP_TO_BOTTOM": 60, - "BIZ_VERIFIED_TRANSITION_BOTTOM_TO_TOP": 61, - "BIZ_INTRO_TOP": 62, - "BIZ_INTRO_BOTTOM": 63, - "BIZ_NAME_CHANGE": 64, - "BIZ_MOVE_TO_CONSUMER_APP": 65, - "BIZ_TWO_TIER_MIGRATION_TOP": 66, - "BIZ_TWO_TIER_MIGRATION_BOTTOM": 67, - "OVERSIZED": 68, - "GROUP_CHANGE_NO_FREQUENTLY_FORWARDED": 69, - "GROUP_V4_ADD_INVITE_SENT": 70, - "GROUP_PARTICIPANT_ADD_REQUEST_JOIN": 71, - "CHANGE_EPHEMERAL_SETTING": 72 - } - } - } - } - } - } - } -} \ No newline at end of file diff --git a/example/.DS_Store b/example/.DS_Store deleted file mode 100644 index f9d4071b14ca589a3d94553e6affc2e555e21fad..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKyG{c!5S)b+0h&}m>5>WwiH_zJl7gBK0P-LLUAQO#l=2!rhOdO#U4yvfYJ||P zWY3 z-wNpYkXRIpjJ2a39jq(`AnG&PjK1a)%1IfEjI|?sXyR0&QzfSu;&isB99Lwl9i0xz z$%o{bzmgZR**Si)a7f`8btn)DG!@wO&z|1@L;fYi<-vO>d@#n9s&H&bL7}My+5hXxFTcisH14R(TVX8FhQaU1%5$+PiC@5 A=Kufz diff --git a/example/example.js b/example/example.js deleted file mode 100644 index f4b0430..0000000 --- a/example/example.js +++ /dev/null @@ -1,106 +0,0 @@ -const WhatsAppWeb = require("../WhatsAppWeb") -const fs = require("fs") - -const client = new WhatsAppWeb() // instantiate -client.autoReconnect = true // auto reconnect on disconnect -client.logUnhandledMessages = false // set to true to see what kind of stuff you can implement -var authInfo = null - -try { - const file = fs.readFileSync("auth_info.json") // load a closed session back if it exists - authInfo = JSON.parse(file) -} catch { } - -client.connect (authInfo, 20*1000) // connect or timeout in 20 seconds -.then (([user, chats, contacts, unread]) => { - console.log ("oh hello " + user.name + " (" + user.id + ")") - console.log ("you have " + unread.length + " unread messages") - console.log ("you have " + chats.length + " chats & " + contacts.length + " contacts") - - const authInfo = client.base64EncodedAuthInfo() // get all the auth info we need to restore this session - fs.writeFileSync("auth_info.json", JSON.stringify(authInfo, null, "\t")) // save this info to a file - /* Note: one can take this auth_info.json file and login again from any computer without having to scan the QR code, - and get full access to one's WhatsApp. Despite the convenience, be careful with this file */ - - client.setOnPresenceUpdate (json => console.log(json.id + " presence is " + json.type)) - client.setOnMessageStatusChange (json => { - const participant = json.participant ? " ("+json.participant+")" : "" // participant exists when the message is from a group - console.log(json.to + participant + - " acknowledged message(s) " + json.ids + - " as " + json.type + " at " + json.timestamp) - }) - client.setOnUnreadMessage (m => { - const [notificationType, messageType] = client.getNotificationType(m) // get what type of notification it is -- message, group add notification etc. - console.log("got notification of type: " + notificationType) - - if (notificationType !== "message") { - return - } - if (m.key.fromMe) { - console.log ("relayed my own message") - return - } - - let sender = m.key.remoteJid - if (m.key.participant) { // participant exists if the message is in a group - sender += " ("+m.key.participant+")" - } - if (messageType === WhatsAppWeb.MessageType.text) { - const text = m.message.conversation - console.log (sender + " sent: " + text) - } else if (messageType === WhatsAppWeb.MessageType.extendedText) { - const text = m.message.extendedTextMessage.text - console.log (sender + " sent: " + text + " and quoted message: " + JSON.stringify(m.message)) - } else if (messageType === WhatsAppWeb.MessageType.contact) { - const contact = m.message.contactMessage - console.log (sender + " sent contact (" + contact.displayName + "): " + contact.vcard) - } else if (messageType === WhatsAppWeb.MessageType.location || messageType === WhatsAppWeb.MessageType.liveLocation) { - const locMessage = m.message[messageType] - console.log (sender + " sent location (lat: " + locMessage.degreesLatitude + ", long: " + locMessage.degreesLongitude + "), saving thumbnail...") - client.decodeMediaMessage(m.message, "loc_thumb_in_" + m.key.id) - - if (messageType === WhatsAppWeb.MessageType.liveLocation) { - console.log (sender + " sent live location for duration: " + m.duration/60 + " minutes, seq number: " + locMessage.sequenceNumber) - } - } else { // if it is a media (audio, image, video) message - // decode, decrypt & save the media. - // The extension to the is applied automatically based on the media type - client.decodeMediaMessage(m.message, "media_in_" + m.key.id) - .then (meta => console.log(sender + " sent media, saved at: " + meta.filename)) - .catch (err => console.log("error in decoding message: " + err)) - } - // send a reply after 3 seconds - setTimeout (() => { - client.sendReadReceipt (m.key.remoteJid, m.key.id) // send read receipt - .then (() => client.updatePresence(m.key.remoteJid, WhatsAppWeb.Presence.available)) // tell them we're available - .then (() => client.updatePresence(m.key.remoteJid, WhatsAppWeb.Presence.composing)) // tell them we're composing - .then (() => { // send the message - let options = {quoted: m} - const rand = Math.random() - if (rand > 0.66) { // choose at random - return client.sendTextMessage(m.key.remoteJid, "hello!", options) // send a "hello!" & quote the message recieved - } else if (rand > 0.33) { // choose at random - return client.sendLocationMessage(m.key.remoteJid, 32.123123, 12.12123123) // send a random location lol - } else { - const buffer = fs.readFileSync("example/ma_gif.mp4") // load the gif - options.gif = true // the video is a gif - options.caption = "hello!" // the caption - return client.sendMediaMessage (m.key.remoteJid, buffer, WhatsAppWeb.MessageType.video, options) // send this gif! - } - }) - .then (([m, q]) => { // check if it went successfully - const success = m.status === 200 - const messageID = q[2][0][2].key.id - console.log("sent message with ID '" + messageID + "' successfully: " + success) - }) - }, 3*1000) - }, true) // set to false to not relay your own sent messages - /* custom functionality for tracking battery */ - client.registerCallback (["action", null, "battery"], json => { - const batteryLevelStr = json[2][0][1].value - const batterylevel = parseInt (batteryLevelStr) - console.log ("battery level: " + batterylevel) - }) - client.setOnUnexpectedDisconnect (err => console.log ("disconnected unexpectedly: " + err) ) -}) -.catch (err => console.log ("encountered error: " + err)) \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 5ba2fc4..eaf43ae 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,9 +1,35 @@ { - "name": "baileys", - "version": "1.1.0", + "name": "@adiwajshing/baileys", + "version": "2.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { + "@babel/code-frame": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", + "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==", + "dev": true, + "requires": { + "@babel/highlight": "^7.10.4" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz", + "integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==", + "dev": true + }, + "@babel/highlight": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", + "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.10.4", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, "@protobufjs/aspromise": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", @@ -58,21 +84,209 @@ "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", "integrity": "sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA=" }, + "@types/color-name": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", + "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==", + "dev": true + }, + "@types/eslint-visitor-keys": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", + "integrity": "sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag==", + "dev": true + }, + "@types/json-schema": { + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.5.tgz", + "integrity": "sha512-7+2BITlgjgDhH0vvwZU/HZJVyk+2XUlvxXe8dFMedNX/aMkaOq++rMAFXc0tM7ij15QaWlbdQASBR9dihi+bDQ==", + "dev": true + }, "@types/long": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.1.tgz", "integrity": "sha512-5tXH6Bx/kNGd3MgffdmP4dy2Z+G4eaXw0SE81Tq3BNadtnMR5/ySMzX4SLEzHJzSmPNn4HIdpQsBvXMUykr58w==" }, + "@types/mocha": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-7.0.2.tgz", + "integrity": "sha512-ZvO2tAcjmMi8V/5Z3JsyofMe3hasRcaw88cto5etSVMwVQfeivGAlEYmaQgceUSVYFofVjT+ioHsATjdWcFt1w==", + "dev": true + }, "@types/node": { - "version": "13.13.9", - "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.9.tgz", - "integrity": "sha512-EPZBIGed5gNnfWCiwEIwTE2Jdg4813odnG8iNPMQGrqVxrI+wL68SPtPeCX+ZxGBaA6pKAVc6jaKgP/Q0QzfdQ==" + "version": "14.0.14", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.14.tgz", + "integrity": "sha512-syUgf67ZQpaJj01/tRTknkMNoBBLWJOBODF0Zm4NrXmiSuxjymFrxnTu1QVYRubhVkRcZLYZG8STTwJRdVm/WQ==", + "dev": true + }, + "@types/sharp": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@types/sharp/-/sharp-0.25.0.tgz", + "integrity": "sha512-JIWCJN0OfHRjkiKyI0BXbym1ip+9KsZJgBsnwNVrJPzm400oO64WxHbyYQ3I5xAqkIrTw1KIqqBME57aOS6n6w==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "@types/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-FKjsOVbC6B7bdSB5CuzyHCkK69I=", + "dev": true + }, + "@types/strip-json-comments": { + "version": "0.0.30", + "resolved": "https://registry.npmjs.org/@types/strip-json-comments/-/strip-json-comments-0.0.30.tgz", + "integrity": "sha512-7NQmHra/JILCd1QqpSzl8+mJRc8ZHz3uDm8YV1Ks9IhK0epEiTw8aIErbvH9PI+6XbqhyIQy3462nEsn7UVzjQ==", + "dev": true + }, + "@typescript-eslint/eslint-plugin": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-3.5.0.tgz", + "integrity": "sha512-m4erZ8AkSjoIUOf8s4k2V1xdL2c1Vy0D3dN6/jC9d7+nEqjY3gxXCkgi3gW/GAxPaA4hV8biaCoTVdQmfAeTCQ==", + "dev": true, + "requires": { + "@typescript-eslint/experimental-utils": "3.5.0", + "debug": "^4.1.1", + "functional-red-black-tree": "^1.0.1", + "regexpp": "^3.0.0", + "semver": "^7.3.2", + "tsutils": "^3.17.1" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + } + } + }, + "@typescript-eslint/experimental-utils": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-3.5.0.tgz", + "integrity": "sha512-zGNOrVi5Wz0jcjUnFZ6QUD0MCox5hBuVwemGCew2qJzUX5xPoyR+0EzS5qD5qQXL/vnQ8Eu+nv03tpeFRwLrDg==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.3", + "@typescript-eslint/types": "3.5.0", + "@typescript-eslint/typescript-estree": "3.5.0", + "eslint-scope": "^5.0.0", + "eslint-utils": "^2.0.0" + } + }, + "@typescript-eslint/parser": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-3.5.0.tgz", + "integrity": "sha512-sU07VbYB70WZHtgOjH/qfAp1+OwaWgrvD1Km1VXqRpcVxt971PMTU7gJtlrCje0M+Sdz7xKAbtiyIu+Y6QdnVA==", + "dev": true, + "requires": { + "@types/eslint-visitor-keys": "^1.0.0", + "@typescript-eslint/experimental-utils": "3.5.0", + "@typescript-eslint/types": "3.5.0", + "@typescript-eslint/typescript-estree": "3.5.0", + "eslint-visitor-keys": "^1.1.0" + } + }, + "@typescript-eslint/types": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-3.5.0.tgz", + "integrity": "sha512-Dreqb5idi66VVs1QkbAwVeDmdJG+sDtofJtKwKCZXIaBsINuCN7Jv5eDIHrS0hFMMiOvPH9UuOs4splW0iZe4Q==", + "dev": true + }, + "@typescript-eslint/typescript-estree": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-3.5.0.tgz", + "integrity": "sha512-Na71ezI6QP5WVR4EHxwcBJgYiD+Sre9BZO5iJK2QhrmRPo/42+b0no/HZIrdD1sjghzlYv7t+7Jis05M1uMxQg==", + "dev": true, + "requires": { + "@typescript-eslint/types": "3.5.0", + "@typescript-eslint/visitor-keys": "3.5.0", + "debug": "^4.1.1", + "glob": "^7.1.6", + "is-glob": "^4.0.1", + "lodash": "^4.17.15", + "semver": "^7.3.2", + "tsutils": "^3.17.1" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + } + } + }, + "@typescript-eslint/visitor-keys": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-3.5.0.tgz", + "integrity": "sha512-7cTp9rcX2sz9Z+zua9MCOX4cqp5rYyFD5o8LlbSpXrMTXoRdngTtotRZEkm8+FNMHPWYFhitFK+qt/brK8BVJQ==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" + } + }, + "acorn": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.3.1.tgz", + "integrity": "sha512-tLc0wSnatxAQHVHUapaHdz72pi9KUyHjq5KyHjGg9Y8Ifdc79pTh2XvI6I1/chZbnM7QtNKzh66ooDogPZSleA==", + "dev": true + }, + "acorn-jsx": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.2.0.tgz", + "integrity": "sha512-HiUX/+K2YpkpJ+SzBffkM/AQ2YE03S0U1kjTLVpoJdhZMOWy8qvXVN9JdLqv2QsaQ6MPYQIuNmwD8zOiYUofLQ==", + "dev": true + }, + "ajv": { + "version": "6.12.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.2.tgz", + "integrity": "sha512-k+V+hzjm5q/Mr8ef/1Y9goCmlsK4I6Sm74teeyGvFk1XrOsbsKLjEdrvny42CZ+a8sXbk8KWpY/bDwS+FLL2UQ==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "dev": true }, "ansi-regex": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "anymatch": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", + "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", + "dev": true, + "requires": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + } + }, "aproba": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", @@ -87,11 +301,89 @@ "readable-stream": "^2.0.6" } }, + "arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "array-filter": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-filter/-/array-filter-1.0.0.tgz", + "integrity": "sha1-uveeYubvTCpMC4MSMtr/7CUfnYM=", + "dev": true + }, + "array-find-index": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", + "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=", + "dev": true + }, + "array.prototype.map": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array.prototype.map/-/array.prototype.map-1.0.2.tgz", + "integrity": "sha512-Az3OYxgsa1g7xDYp86l0nnN4bcmuEITGe1rbdEBVkrqkzMgDcbdQ2R7r41pNzti+4NMces3H8gMmuioZUilLgw==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1", + "es-array-method-boxes-properly": "^1.0.0", + "is-string": "^1.0.4" + } + }, + "assert": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/assert/-/assert-2.0.0.tgz", + "integrity": "sha512-se5Cd+js9dXJnu6Ag2JFc00t+HmHOen+8Q+L7O9zI0PqQXr20uk2J0XQqMxZEeo5U50o8Nvmmx7dZrl+Ufr35A==", + "dev": true, + "requires": { + "es6-object-assign": "^1.1.0", + "is-nan": "^1.2.1", + "object-is": "^1.0.1", + "util": "^0.12.0" + } + }, + "astral-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", + "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", + "dev": true + }, + "available-typed-arrays": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.2.tgz", + "integrity": "sha512-XWX3OX8Onv97LMk/ftVyBibpGwY5a8SmuxZPzeOxqmuEqUCOM9ZE+uIaD1VNJ5QnvU2UQusvmKbuM1FR8QWGfQ==", + "dev": true, + "requires": { + "array-filter": "^1.0.0" + } + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, "base64-js": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz", "integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==" }, + "binary-extensions": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.0.0.tgz", + "integrity": "sha512-Phlt0plgpIIBOGTT/ehfFnbNlfsDEiqmzE2KRXoX1bLIlir4X/MR+zSyBEkL05ffWgnRSf/DXv+WrUAVr93/ow==", + "dev": true + }, "bl": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/bl/-/bl-4.0.2.tgz", @@ -114,6 +406,31 @@ } } }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "browser-stdout": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", + "dev": true + }, "buffer": { "version": "5.6.0", "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.6.0.tgz", @@ -123,11 +440,122 @@ "ieee754": "^1.1.4" } }, + "buffer-from": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "dev": true + }, + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true + }, + "camelcase": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", + "integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=", + "dev": true + }, + "camelcase-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", + "integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=", + "dev": true, + "requires": { + "camelcase": "^2.0.0", + "map-obj": "^1.0.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "dependencies": { + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "chokidar": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.4.0.tgz", + "integrity": "sha512-aXAaho2VJtisB/1fg1+3nlLJqGOuewTzQpd/Tz0yTg2R0e4IGtshYvtjowyEumcBv2z+y4+kc75Mz7j5xJskcQ==", + "dev": true, + "requires": { + "anymatch": "~3.1.1", + "braces": "~3.0.2", + "fsevents": "~2.1.2", + "glob-parent": "~5.1.0", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.4.0" + } + }, "chownr": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==" }, + "cliui": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", + "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", + "dev": true, + "requires": { + "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", + "wrap-ansi": "^5.1.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, "code-point-at": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", @@ -164,6 +592,12 @@ "simple-swizzle": "^0.2.2" } }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, "console-control-strings": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", @@ -174,11 +608,67 @@ "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "dependencies": { + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } + }, + "currently-unhandled": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", + "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", + "dev": true, + "requires": { + "array-find-index": "^1.0.1" + } + }, "curve25519-js": { "version": "0.0.4", "resolved": "https://registry.npmjs.org/curve25519-js/-/curve25519-js-0.0.4.tgz", "integrity": "sha512-axn2UMEnkhyDUPWOwVKBMVIzSQy2ejH2xRGy1wq81dqRwApXfIzfbE3hIX0ZRFBIihf/KDqK158DLwESu4AK1w==" }, + "dateformat": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-1.0.12.tgz", + "integrity": "sha1-nxJLZ1lMk3/3BpMuSmQsyo27/uk=", + "dev": true, + "requires": { + "get-stdin": "^4.0.1", + "meow": "^3.3.0" + } + }, + "debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true + }, "decompress-response": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-4.2.1.tgz", @@ -192,6 +682,21 @@ "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==" }, + "deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "dev": true + }, + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dev": true, + "requires": { + "object-keys": "^1.0.12" + } + }, "delegates": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", @@ -202,6 +707,36 @@ "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=" }, + "diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true + }, + "doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + }, + "dynamic-dedupe": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/dynamic-dedupe/-/dynamic-dedupe-0.3.0.tgz", + "integrity": "sha1-BuRMIj9eTpTXjvnbI6ZRXOL5YqE=", + "dev": true, + "requires": { + "xtend": "^4.0.0" + } + }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, "end-of-stream": { "version": "1.4.4", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", @@ -210,11 +745,428 @@ "once": "^1.4.0" } }, + "enquirer": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.5.tgz", + "integrity": "sha512-BNT1C08P9XD0vNg3J475yIUG+mVdp9T6towYFHUv897X0KoHBjB1shyrNmhmtHWKP17iSWgo7Gqh7BBuzLZMSA==", + "dev": true, + "requires": { + "ansi-colors": "^3.2.1" + }, + "dependencies": { + "ansi-colors": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.4.tgz", + "integrity": "sha512-hHUXGagefjN2iRrID63xckIvotOXOojhQKWIPUZ4mNUZ9nLZW+7FMNoE1lOkEhNWYsx/7ysGIuJYCiMAA9FnrA==", + "dev": true + } + } + }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "requires": { + "is-arrayish": "^0.2.1" + }, + "dependencies": { + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + } + } + }, + "es-abstract": { + "version": "1.17.6", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.6.tgz", + "integrity": "sha512-Fr89bON3WFyUi5EvAeI48QTWX0AyekGgLA8H+c+7fbfCkJwRWRMLd8CQedNEyJuoYYhmtEqY92pgte1FAhBlhw==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.0", + "is-regex": "^1.1.0", + "object-inspect": "^1.7.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" + } + }, + "es-array-method-boxes-properly": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-array-method-boxes-properly/-/es-array-method-boxes-properly-1.0.0.tgz", + "integrity": "sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA==", + "dev": true + }, + "es-get-iterator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/es-get-iterator/-/es-get-iterator-1.1.0.tgz", + "integrity": "sha512-UfrmHuWQlNMTs35e1ypnvikg6jCz3SK8v8ImvmDsh36fCVUR1MqoFDiyn0/k52C8NqO3YsO8Oe0azeesNuqSsQ==", + "dev": true, + "requires": { + "es-abstract": "^1.17.4", + "has-symbols": "^1.0.1", + "is-arguments": "^1.0.4", + "is-map": "^2.0.1", + "is-set": "^2.0.1", + "is-string": "^1.0.5", + "isarray": "^2.0.5" + }, + "dependencies": { + "isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true + } + } + }, + "es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, + "es6-object-assign": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/es6-object-assign/-/es6-object-assign-1.1.0.tgz", + "integrity": "sha1-wsNYJlYkfDnqEHyx5mUrb58kUjw=", + "dev": true + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "eslint": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.3.1.tgz", + "integrity": "sha512-cQC/xj9bhWUcyi/RuMbRtC3I0eW8MH0jhRELSvpKYkWep3C6YZ2OkvcvJVUeO6gcunABmzptbXBuDoXsjHmfTA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "enquirer": "^2.3.5", + "eslint-scope": "^5.1.0", + "eslint-utils": "^2.0.0", + "eslint-visitor-keys": "^1.2.0", + "espree": "^7.1.0", + "esquery": "^1.2.0", + "esutils": "^2.0.2", + "file-entry-cache": "^5.0.1", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^5.0.0", + "globals": "^12.1.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "js-yaml": "^3.13.1", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash": "^4.17.14", + "minimatch": "^3.0.4", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "progress": "^2.0.0", + "regexpp": "^3.1.0", + "semver": "^7.2.1", + "strip-ansi": "^6.0.0", + "strip-json-comments": "^3.1.0", + "table": "^5.2.3", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + }, + "strip-json-comments": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.0.tgz", + "integrity": "sha512-e6/d0eBu7gHtdCqFt0xJr642LdToM5/cN4Qb9DbHjVx1CP5RyeM+zH7pbecEmDv/lBqb0QH+6Uqq75rxFPkM0w==", + "dev": true + } + } + }, + "eslint-config-prettier": { + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-6.11.0.tgz", + "integrity": "sha512-oB8cpLWSAjOVFEJhhyMZh6NOEOtBVziaqdDQ86+qhDHFbZXoRTM7pNSvFRfW/W/L/LrQ38C99J5CGuRBBzBsdA==", + "dev": true, + "requires": { + "get-stdin": "^6.0.0" + }, + "dependencies": { + "get-stdin": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz", + "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==", + "dev": true + } + } + }, + "eslint-plugin-prettier": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.4.tgz", + "integrity": "sha512-jZDa8z76klRqo+TdGDTFJSavwbnWK2ZpqGKNZ+VvweMW516pDUMmQ2koXvxEE4JhzNvTv+radye/bWGBmA6jmg==", + "dev": true, + "requires": { + "prettier-linter-helpers": "^1.0.0" + } + }, + "eslint-scope": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.0.tgz", + "integrity": "sha512-iiGRvtxWqgtx5m8EyQUJihBloE4EnYeGE/bz1wSPwJE6tZuJUtHlhqDM4Xj2ukE8Dyy1+HCZ4hE0fzIVMzb58w==", + "dev": true, + "requires": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + } + }, + "eslint-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" + } + }, + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true + }, + "espree": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-7.1.0.tgz", + "integrity": "sha512-dcorZSyfmm4WTuTnE5Y7MEN1DyoPYy1ZR783QW1FJoenn7RailyWFsq/UL6ZAAA7uXurN9FIpYyUs3OfiIW+Qw==", + "dev": true, + "requires": { + "acorn": "^7.2.0", + "acorn-jsx": "^5.2.0", + "eslint-visitor-keys": "^1.2.0" + } + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "esquery": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.3.1.tgz", + "integrity": "sha512-olpvt9QG0vniUBZspVRN6lwB7hOZoTRtT+jzR+tS4ffYx2mzbw+z0XCOk44aaLYKApNX5nMm+E+P6o25ip/DHQ==", + "dev": true, + "requires": { + "estraverse": "^5.1.0" + }, + "dependencies": { + "estraverse": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.1.0.tgz", + "integrity": "sha512-FyohXK+R0vE+y1nHLoBM7ZTyqRpqAlhdZHCWIWEviFLiGB8b04H6bQs8G+XTthacvT8VuwvteiP7RJSxMs8UEw==", + "dev": true + } + } + }, + "esrecurse": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", + "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", + "dev": true, + "requires": { + "estraverse": "^4.1.0" + } + }, + "estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true + }, + "esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true + }, "expand-template": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==" }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "fast-diff": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz", + "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==", + "dev": true + }, + "fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "file-entry-cache": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", + "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", + "dev": true, + "requires": { + "flat-cache": "^2.0.1" + } + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "find-up": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "dev": true, + "requires": { + "path-exists": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "flat": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/flat/-/flat-4.1.0.tgz", + "integrity": "sha512-Px/TiLIznH7gEDlPXcUD4KnBusa6kR6ayRUVcnEAbreRIuhkqow/mun59BuRXwoYk7ZQOLW1ZM05ilIvK38hFw==", + "dev": true, + "requires": { + "is-buffer": "~2.0.3" + } + }, + "flat-cache": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", + "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", + "dev": true, + "requires": { + "flatted": "^2.0.0", + "rimraf": "2.6.3", + "write": "1.0.3" + }, + "dependencies": { + "rimraf": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + } + } + }, + "flatted": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.2.tgz", + "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==", + "dev": true + }, + "foreach": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz", + "integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k=", + "dev": true + }, "fs-constants": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", @@ -228,6 +1180,31 @@ "minipass": "^3.0.0" } }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "fsevents": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", + "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", + "dev": true, + "optional": true + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, "futoin-hkdf": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/futoin-hkdf/-/futoin-hkdf-1.3.2.tgz", @@ -248,21 +1225,157 @@ "wide-align": "^1.1.0" } }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true + }, + "get-stdin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", + "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=", + "dev": true + }, "github-from-package": { "version": "0.0.0", "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", "integrity": "sha1-l/tdlr/eiXMxPyDoKI75oWf6ZM4=" }, + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-parent": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", + "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "globals": { + "version": "12.4.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", + "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", + "dev": true, + "requires": { + "type-fest": "^0.8.1" + } + }, + "graceful-fs": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", + "dev": true + }, + "growl": { + "version": "1.10.5", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", + "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", + "dev": true + }, + "growly": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/growly/-/growly-1.3.0.tgz", + "integrity": "sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE=", + "dev": true + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "has-symbols": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", + "dev": true + }, "has-unicode": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=" }, + "he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "dev": true + }, + "hosted-git-info": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", + "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", + "dev": true + }, "ieee754": { "version": "1.1.13", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==" }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + }, + "import-fresh": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz", + "integrity": "sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ==", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + } + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "indent-string": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz", + "integrity": "sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=", + "dev": true, + "requires": { + "repeating": "^2.0.0" + } + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, "inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", @@ -273,11 +1386,56 @@ "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==" }, + "is-arguments": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.0.4.tgz", + "integrity": "sha512-xPh0Rmt8NE65sNzvyUmWgI1tz3mKq74lGA0mL8LYZcoIzKOzDh6HmrYm3d18k60nHerC8A9Km8kYu87zfSFnLA==", + "dev": true + }, "is-arrayish": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==" }, + "is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "requires": { + "binary-extensions": "^2.0.0" + } + }, + "is-buffer": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.4.tgz", + "integrity": "sha512-Kq1rokWXOPXWuaMAqZiJW4XxsmD9zGx9q4aePabbn3qCRGedtH7Cm+zV8WETitMfu1wdh+Rvd6w5egwSngUX2A==", + "dev": true + }, + "is-callable": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.0.tgz", + "integrity": "sha512-pyVD9AaGLxtg6srb2Ng6ynWJqkHU9bEM087AKck0w8QwDarTfNcpIYoU8x8Hv2Icm8u6kFJM18Dag8lyqGkviw==", + "dev": true + }, + "is-date-object": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", + "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==", + "dev": true + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, + "is-finite": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.1.0.tgz", + "integrity": "sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w==", + "dev": true + }, "is-fullwidth-code-point": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", @@ -286,21 +1444,257 @@ "number-is-nan": "^1.0.0" } }, + "is-generator-function": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.7.tgz", + "integrity": "sha512-YZc5EwyO4f2kWCax7oegfuSr9mFz1ZvieNYBEjmukLxgXfBUbxAWGVF7GZf0zidYtoBl3WvC07YK0wT76a+Rtw==", + "dev": true + }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-map": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.1.tgz", + "integrity": "sha512-T/S49scO8plUiAOA2DBTBG3JHpn1yiw0kRp6dgiZ0v2/6twi5eiB0rHtHFH9ZIrvlWc6+4O+m4zg5+Z833aXgw==", + "dev": true + }, + "is-nan": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/is-nan/-/is-nan-1.3.0.tgz", + "integrity": "sha512-z7bbREymOqt2CCaZVly8aC4ML3Xhfi0ekuOnjO2L8vKdl+CttdVoGZQhd4adMFAsxQ5VeRVwORs4tU8RH+HFtQ==", + "dev": true, + "requires": { + "define-properties": "^1.1.3" + } + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "is-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.0.tgz", + "integrity": "sha512-iI97M8KTWID2la5uYXlkbSDQIg4F6o1sYboZKKTDpnDQMLtUL86zxhgDet3Q2SriaYsyGqZ6Mn2SjbRKeLHdqw==", + "dev": true, + "requires": { + "has-symbols": "^1.0.1" + } + }, + "is-set": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.1.tgz", + "integrity": "sha512-eJEzOtVyenDs1TMzSQ3kU3K+E0GUS9sno+F0OBT97xsgcJsF9nXMBtkT9/kut5JEpM7oL7X/0qxR17K3mcwIAA==", + "dev": true + }, + "is-string": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.5.tgz", + "integrity": "sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ==", + "dev": true + }, + "is-symbol": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", + "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", + "dev": true, + "requires": { + "has-symbols": "^1.0.1" + } + }, + "is-typed-array": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.3.tgz", + "integrity": "sha512-BSYUBOK/HJibQ30wWkWold5txYwMUXQct9YHAQJr8fSwvZoiglcqB0pd7vEN23+Tsi9IUEjztdOSzl4qLVYGTQ==", + "dev": true, + "requires": { + "available-typed-arrays": "^1.0.0", + "es-abstract": "^1.17.4", + "foreach": "^2.0.5", + "has-symbols": "^1.0.1" + } + }, + "is-utf8": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", + "dev": true + }, + "is-wsl": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz", + "integrity": "sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0=", + "dev": true + }, "isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "iterate-iterator": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/iterate-iterator/-/iterate-iterator-1.0.1.tgz", + "integrity": "sha512-3Q6tudGN05kbkDQDI4CqjaBf4qf85w6W6GnuZDtUVYwKgtC1q8yxYX7CZed7N+tLzQqS6roujWvszf13T+n9aw==", + "dev": true + }, + "iterate-value": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/iterate-value/-/iterate-value-1.0.2.tgz", + "integrity": "sha512-A6fMAio4D2ot2r/TYzr4yUWrmwNdsN5xL7+HUiyACE4DXm+q8HtPcnFTp+NnW3k4N05tZ7FVYFFb2CR13NxyHQ==", + "dev": true, + "requires": { + "es-get-iterator": "^1.0.2", + "iterate-iterator": "^1.0.1" + } + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "js-yaml": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, + "levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + } + }, + "load-json-file": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", + "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "strip-bom": "^2.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "dev": true + }, + "log-symbols": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-3.0.0.tgz", + "integrity": "sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ==", + "dev": true, + "requires": { + "chalk": "^2.4.2" + } + }, "long": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" }, + "loud-rejection": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz", + "integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=", + "dev": true, + "requires": { + "currently-unhandled": "^0.4.1", + "signal-exit": "^3.0.0" + } + }, + "make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true + }, + "map-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", + "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", + "dev": true + }, + "meow": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz", + "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=", + "dev": true, + "requires": { + "camelcase-keys": "^2.0.0", + "decamelize": "^1.1.2", + "loud-rejection": "^1.0.0", + "map-obj": "^1.0.1", + "minimist": "^1.1.3", + "normalize-package-data": "^2.3.4", + "object-assign": "^4.0.1", + "read-pkg-up": "^1.0.1", + "redent": "^1.0.0", + "trim-newlines": "^1.0.0" + } + }, "mimic-response": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-2.1.0.tgz", "integrity": "sha512-wXqjST+SLt7R009ySCglWBCFpjUygmCIfD790/kVbiGmUgfYGuB14PiTd5DwVxSV4NcYHjzMkoj5LjQZwTQLEA==" }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, "minimist": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", @@ -336,11 +1730,114 @@ "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==" }, + "mocha": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-8.0.1.tgz", + "integrity": "sha512-vefaXfdYI8+Yo8nPZQQi0QO2o+5q9UIMX1jZ1XMmK3+4+CQjc7+B0hPdUeglXiTlr8IHMVRo63IhO9Mzt6fxOg==", + "dev": true, + "requires": { + "ansi-colors": "4.1.1", + "browser-stdout": "1.3.1", + "chokidar": "3.3.1", + "debug": "3.2.6", + "diff": "4.0.2", + "escape-string-regexp": "1.0.5", + "find-up": "4.1.0", + "glob": "7.1.6", + "growl": "1.10.5", + "he": "1.2.0", + "js-yaml": "3.13.1", + "log-symbols": "3.0.0", + "minimatch": "3.0.4", + "ms": "2.1.2", + "object.assign": "4.1.0", + "promise.allsettled": "1.0.2", + "serialize-javascript": "3.0.0", + "strip-json-comments": "3.0.1", + "supports-color": "7.1.0", + "which": "2.0.2", + "wide-align": "1.1.3", + "workerpool": "6.0.0", + "yargs": "13.3.2", + "yargs-parser": "13.1.2", + "yargs-unparser": "1.6.0" + }, + "dependencies": { + "chokidar": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.3.1.tgz", + "integrity": "sha512-4QYCEWOcK3OJrxwvyyAOxFuhpvOVCYkr33LPfFNBjAD/w3sEzWsp2BUOkI4l9bHvWioAd0rc6NlHUOEaWkTeqg==", + "dev": true, + "requires": { + "anymatch": "~3.1.1", + "braces": "~3.0.2", + "fsevents": "~2.1.2", + "glob-parent": "~5.1.0", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.3.0" + } + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, + "readdirp": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.3.0.tgz", + "integrity": "sha512-zz0pAkSPOXXm1viEwygWIPSPkcBYjW1xU5j/JBh5t9bGCJwa6f9+BJa6VaB2g+b55yVrmXzqkyLf4xaWYM0IkQ==", + "dev": true, + "requires": { + "picomatch": "^2.0.7" + } + }, + "strip-json-comments": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.0.1.tgz", + "integrity": "sha512-VTyMAUfdm047mwKl+u79WIdrZxtFtn+nBxHeb844XBQ9uMNTuTHdx2hc5RiAJYqwTj3wc/xe5HLSdJSkJ+WfZw==", + "dev": true + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, "napi-build-utils": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz", "integrity": "sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==" }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, "node-abi": { "version": "2.18.0", "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.18.0.tgz", @@ -366,11 +1863,58 @@ "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz", "integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA==" }, + "node-notifier": { + "version": "5.4.3", + "resolved": "https://registry.npmjs.org/node-notifier/-/node-notifier-5.4.3.tgz", + "integrity": "sha512-M4UBGcs4jeOK9CjTsYwkvH6/MzuUmGCyTW+kCY7uO+1ZVr0+FHGdPdIf5CCLqAaxnRrWidyoQlNkMIIVwbKB8Q==", + "dev": true, + "requires": { + "growly": "^1.3.0", + "is-wsl": "^1.1.0", + "semver": "^5.5.0", + "shellwords": "^0.1.1", + "which": "^1.3.0" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, "noop-logger": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/noop-logger/-/noop-logger-0.1.1.tgz", "integrity": "sha1-lKKxYzxPExdVMAfYlm/Q6EG2pMI=" }, + "normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true + }, "npmlog": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", @@ -392,6 +1936,40 @@ "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" }, + "object-inspect": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.8.0.tgz", + "integrity": "sha512-jLdtEOB112fORuypAyl/50VRVIBIdVQOSUUGQHzJ4xBSbit81zRarz7GThkEFZy1RceYrWYcPcBFPQwHyAc1gA==", + "dev": true + }, + "object-is": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.2.tgz", + "integrity": "sha512-5lHCz+0uufF6wZ7CRFWJN3hp8Jqblpgve06U5CMQ3f//6iDjPr2PEo9MWCjEssDsa+UZEL4PkFpr+BMop6aKzQ==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + } + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true + }, + "object.assign": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", + "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "function-bind": "^1.1.1", + "has-symbols": "^1.0.0", + "object-keys": "^1.0.11" + } + }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -400,10 +1978,131 @@ "wrappy": "1" } }, + "optionator": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "dev": true, + "requires": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "requires": { + "callsites": "^3.0.0" + } + }, + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "dev": true, + "requires": { + "error-ex": "^1.2.0" + } + }, + "path-exists": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", + "dev": true, + "requires": { + "pinkie-promise": "^2.0.0" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, + "path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "dev": true + }, + "path-type": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", + "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "picomatch": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", + "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", + "dev": true + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "dev": true + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "dev": true, + "requires": { + "pinkie": "^2.0.0" + } + }, "prebuild-install": { - "version": "5.3.4", - "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-5.3.4.tgz", - "integrity": "sha512-AkKN+pf4fSEihjapLEEj8n85YIw/tN6BQqkhzbDc0RvEZGdkpJBGMUYx66AAMcPG2KzmPQS7Cm16an4HVBRRMA==", + "version": "5.3.5", + "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-5.3.5.tgz", + "integrity": "sha512-YmMO7dph9CYKi5IR/BzjOJlRzpxGGVo1EsLSUZ0mt/Mq0HWZIHOKHHcHdT69yG54C9m6i45GpItwRHpk0Py7Uw==", "requires": { "detect-libc": "^1.0.3", "expand-template": "^2.0.3", @@ -434,11 +2133,51 @@ } } }, + "prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true + }, + "prettier": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.0.5.tgz", + "integrity": "sha512-7PtVymN48hGcO4fGjybyBSIWDsLU4H4XlvOHfq91pz9kkGlonzwTfYkaIEwiRg/dAJF9YlbsduBAgtYLi+8cFg==", + "dev": true + }, + "prettier-linter-helpers": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", + "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", + "dev": true, + "requires": { + "fast-diff": "^1.1.2" + } + }, "process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" }, + "progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true + }, + "promise.allsettled": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/promise.allsettled/-/promise.allsettled-1.0.2.tgz", + "integrity": "sha512-UpcYW5S1RaNKT6pd+s9jp9K9rlQge1UXKskec0j6Mmuq7UJCvlS2J2/s/yuPN8ehftf9HXMxWlKiPbGGUzpoRg==", + "dev": true, + "requires": { + "array.prototype.map": "^1.0.1", + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1", + "function-bind": "^1.1.1", + "iterate-value": "^1.0.0" + } + }, "protobufjs": { "version": "6.9.0", "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.9.0.tgz", @@ -457,6 +2196,13 @@ "@types/long": "^4.0.1", "@types/node": "^13.7.0", "long": "^4.0.0" + }, + "dependencies": { + "@types/node": { + "version": "13.13.12", + "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.12.tgz", + "integrity": "sha512-zWz/8NEPxoXNT9YyF2osqyA9WjssZukYpgI4UYZpOjcyqwIUqWGkcCionaEb9Ki+FULyPyvNFpg/329Kd2/pbw==" + } } }, "pump": { @@ -468,6 +2214,12 @@ "once": "^1.3.1" } }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + }, "qrcode-terminal": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/qrcode-terminal/-/qrcode-terminal-0.12.0.tgz", @@ -484,6 +2236,27 @@ "strip-json-comments": "~2.0.1" } }, + "read-pkg": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", + "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", + "dev": true, + "requires": { + "load-json-file": "^1.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^1.0.0" + } + }, + "read-pkg-up": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", + "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", + "dev": true, + "requires": { + "find-up": "^1.0.0", + "read-pkg": "^1.0.0" + } + }, "readable-stream": { "version": "2.3.7", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", @@ -498,6 +2271,76 @@ "util-deprecate": "~1.0.1" } }, + "readdirp": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.4.0.tgz", + "integrity": "sha512-0xe001vZBnJEK+uKcj8qOhyAKPzIT+gStxWr3LCB0DwcXR5NZJ3IaC+yGnHCYzB/S7ov3m3EEbZI2zeNvX+hGQ==", + "dev": true, + "requires": { + "picomatch": "^2.2.1" + } + }, + "redent": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz", + "integrity": "sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=", + "dev": true, + "requires": { + "indent-string": "^2.1.0", + "strip-indent": "^1.0.1" + } + }, + "regexpp": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", + "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", + "dev": true + }, + "repeating": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", + "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", + "dev": true, + "requires": { + "is-finite": "^1.0.0" + } + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true + }, + "require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "dev": true + }, + "resolve": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", + "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } + }, + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true + }, + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, "safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", @@ -508,27 +2351,54 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==" }, + "serialize-javascript": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-3.0.0.tgz", + "integrity": "sha512-skZcHYw2vEX4bw90nAr2iTTsz6x2SrHEnfxgKYmZlvJYBEZrvbKtobJWlQ20zczKb3bsHHXXTYt48zBA7ni9cw==", + "dev": true + }, "set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" }, "sharp": { - "version": "0.25.3", - "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.25.3.tgz", - "integrity": "sha512-qV3n30NaBEhAjBhFo+d8h5N4X3DHteFdwxXoWUiubk72G0VKT5fX50nlcawGYjPqfFV4Z2e/G9gDPeSGAdn/gg==", + "version": "0.25.4", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.25.4.tgz", + "integrity": "sha512-umSzJJ1oBwIOfwFFt/fJ7JgCva9FvrEU2cbbm7u/3hSDZhXvkME8WE5qpaJqLIe2Har5msF5UG4CzYlEg5o3BQ==", "requires": { "color": "^3.1.2", "detect-libc": "^1.0.3", "node-addon-api": "^3.0.0", "npmlog": "^4.1.2", - "prebuild-install": "^5.3.3", + "prebuild-install": "^5.3.4", "semver": "^7.3.2", "simple-get": "^4.0.0", "tar": "^6.0.2", "tunnel-agent": "^0.6.0" } }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, + "shellwords": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/shellwords/-/shellwords-0.1.1.tgz", + "integrity": "sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==", + "dev": true + }, "signal-exit": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", @@ -572,6 +2442,79 @@ "is-arrayish": "^0.3.1" } }, + "slice-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", + "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "astral-regex": "^1.0.0", + "is-fullwidth-code-point": "^2.0.0" + }, + "dependencies": { + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + } + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "source-map-support": { + "version": "0.5.19", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", + "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "spdx-correct": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", + "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", + "dev": true, + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", + "dev": true + }, + "spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dev": true, + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", + "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==", + "dev": true + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, "string-width": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", @@ -582,6 +2525,26 @@ "strip-ansi": "^3.0.0" } }, + "string.prototype.trimend": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz", + "integrity": "sha512-LRPxFUaTtpqYsTeNKaFOw3R4bxIzWOnbQ837QfBylo8jIxtcbK/A/sMV7Q+OAV/vWo+7s25pOE10KYSjaSO06g==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + } + }, + "string.prototype.trimstart": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.1.tgz", + "integrity": "sha512-XxZn+QpvrBI1FOcg6dIpxUPgWCPuNXvMD72aaRaUQv1eD4e/Qy8i/hFTe0BUmD60p/QA6bh1avmuPTfNjqVWRw==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + } + }, "string_decoder": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", @@ -598,11 +2561,92 @@ "ansi-regex": "^2.0.0" } }, + "strip-bom": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "dev": true, + "requires": { + "is-utf8": "^0.2.0" + } + }, + "strip-indent": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz", + "integrity": "sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=", + "dev": true, + "requires": { + "get-stdin": "^4.0.1" + } + }, "strip-json-comments": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=" }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + }, + "dependencies": { + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + } + } + }, + "table": { + "version": "5.4.6", + "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", + "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", + "dev": true, + "requires": { + "ajv": "^6.10.2", + "lodash": "^4.17.14", + "slice-ansi": "^2.1.0", + "string-width": "^3.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, "tar": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/tar/-/tar-6.0.2.tgz", @@ -663,6 +2707,109 @@ } } }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + }, + "tree-kill": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", + "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", + "dev": true + }, + "trim-newlines": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz", + "integrity": "sha1-WIeWa7WCpFA6QetST301ARgVphM=", + "dev": true + }, + "ts-node": { + "version": "8.10.2", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.10.2.tgz", + "integrity": "sha512-ISJJGgkIpDdBhWVu3jufsWpK3Rzo7bdiIXJjQc0ynKxVOVcg2oIrf2H2cejminGrptVc6q6/uynAHNCuWGbpVA==", + "dev": true, + "requires": { + "arg": "^4.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "source-map-support": "^0.5.17", + "yn": "3.1.1" + } + }, + "ts-node-dev": { + "version": "1.0.0-pre.49", + "resolved": "https://registry.npmjs.org/ts-node-dev/-/ts-node-dev-1.0.0-pre.49.tgz", + "integrity": "sha512-iJd4QPPOaCAByl/WuEdmDX8xDR2GmoWYu6aKvGudGUcfP1sJRjpaHb7oFDuvBspQF1xhxUdbjfHuvEtZPwKZFQ==", + "dev": true, + "requires": { + "chokidar": "^3.4.0", + "dateformat": "~1.0.4-1.2.3", + "dynamic-dedupe": "^0.3.0", + "minimist": "^1.2.5", + "mkdirp": "^1.0.4", + "node-notifier": "^5.4.0", + "resolve": "^1.0.0", + "rimraf": "^2.6.1", + "source-map-support": "^0.5.12", + "tree-kill": "^1.2.2", + "ts-node": "^8.10.2", + "tsconfig": "^7.0.0" + }, + "dependencies": { + "mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true + } + } + }, + "tsconfig": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/tsconfig/-/tsconfig-7.0.0.tgz", + "integrity": "sha512-vZXmzPrL+EmC4T/4rVlT2jNVMWCi/O4DIiSj3UHg1OE5kCKbk4mfrXc6dZksLgRM/TZlKnousKH9bbTazUWRRw==", + "dev": true, + "requires": { + "@types/strip-bom": "^3.0.0", + "@types/strip-json-comments": "0.0.30", + "strip-bom": "^3.0.0", + "strip-json-comments": "^2.0.0" + }, + "dependencies": { + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + } + } + }, + "tslib": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz", + "integrity": "sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q==", + "dev": true + }, + "tsutils": { + "version": "3.17.1", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.17.1.tgz", + "integrity": "sha512-kzeQ5B8H3w60nFY2g8cJIuH7JDpsALXySGtwGJ0p2LSjLgay3NdIpqq5SoOBe46bKDW2iq25irHCr8wjomUS2g==", + "dev": true, + "requires": { + "tslib": "^1.8.1" + } + }, "tunnel-agent": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", @@ -671,21 +2818,105 @@ "safe-buffer": "^5.0.1" } }, + "type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1" + } + }, + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true + }, + "typescript": { + "version": "3.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.5.tgz", + "integrity": "sha512-hSAifV3k+i6lEoCJ2k6R2Z/rp/H3+8sdmcn5NrS3/3kE7+RyZXm9aqvxWqjEXHAd8b0pShatpcdMTvEdvAJltQ==", + "dev": true + }, + "uri-js": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, + "util": { + "version": "0.12.3", + "resolved": "https://registry.npmjs.org/util/-/util-0.12.3.tgz", + "integrity": "sha512-I8XkoQwE+fPQEhy9v012V+TSdH2kp9ts29i20TaaDUXsg7x/onePbhFJUExBfv/2ay1ZOp/Vsm3nDlmnFGSAog==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "is-arguments": "^1.0.4", + "is-generator-function": "^1.0.7", + "is-typed-array": "^1.1.3", + "safe-buffer": "^5.1.2", + "which-typed-array": "^1.1.2" + } + }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" }, - "video-thumb": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/video-thumb/-/video-thumb-0.0.3.tgz", - "integrity": "sha1-GMbS8wRIO1tVWzdZzUOI9uigjQg=" + "v8-compile-cache": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.1.1.tgz", + "integrity": "sha512-8OQ9CL+VWyt3JStj7HX7/ciTL2V3Rl1Wf5OL+SNTm0yK1KvtReVulksyeRnCANHHuUxHlQig+JJDlUhBt1NQDQ==", + "dev": true + }, + "validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "dev": true }, "which-pm-runs": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.0.0.tgz", "integrity": "sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs=" }, + "which-typed-array": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.2.tgz", + "integrity": "sha512-KT6okrd1tE6JdZAy3o2VhMoYPh3+J6EMZLyrxBQsZflI1QCZIxMrIYLkosd8Twf+YfknVIHmYQPgJt238p8dnQ==", + "dev": true, + "requires": { + "available-typed-arrays": "^1.0.2", + "es-abstract": "^1.17.5", + "foreach": "^2.0.5", + "function-bind": "^1.1.1", + "has-symbols": "^1.0.1", + "is-typed-array": "^1.1.3" + } + }, "wide-align": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", @@ -694,20 +2925,219 @@ "string-width": "^1.0.2 || 2" } }, + "word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "dev": true + }, + "workerpool": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.0.0.tgz", + "integrity": "sha512-fU2OcNA/GVAJLLyKUoHkAgIhKb0JoCpSjLC/G2vYKxUjVmQwGbRVeoPJ1a8U4pnVofz4AQV5Y/NEw8oKqxEBtA==", + "dev": true + }, + "wrap-ansi": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, + "write": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz", + "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==", + "dev": true, + "requires": { + "mkdirp": "^0.5.1" + } + }, "ws": { "version": "7.3.0", "resolved": "https://registry.npmjs.org/ws/-/ws-7.3.0.tgz", "integrity": "sha512-iFtXzngZVXPGgpTlP1rBqsUK82p9tKqsWRPg5L56egiljujJT3vGAYnHANvFxBieXrTFavhzhxW52jnaWV+w2w==" }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "dev": true + }, + "y18n": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", + "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", + "dev": true + }, "yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + }, + "yargs": { + "version": "13.3.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", + "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", + "dev": true, + "requires": { + "cliui": "^5.0.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^3.0.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^13.1.2" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, + "yargs-parser": { + "version": "13.1.2", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", + "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + }, + "dependencies": { + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + } + } + }, + "yargs-unparser": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.6.0.tgz", + "integrity": "sha512-W9tKgmSn0DpSatfri0nx52Joq5hVXgeLiqR/5G0sZNDoLZFOr/xjBUDcShCOGNsBnEMNo1KAMBkTej1Hm62HTw==", + "dev": true, + "requires": { + "flat": "^4.1.0", + "lodash": "^4.17.15", + "yargs": "^13.3.0" + } + }, + "yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "dev": true } } } diff --git a/package.json b/package.json index 6347f6e..0c921e2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@adiwajshing/baileys", - "version": "1.1.1", + "version": "2.0.0", "description": "WhatsApp Web API", "main": "WhatsAppWeb.js", "homepage": "https://github.com/adiwajshing/Baileys", @@ -16,19 +16,39 @@ "automation" ], "scripts": { - "test": "node test.js" + "test": "mocha --timeout 30000 -r ts-node/register */Tests.ts", + "lint": "eslint '*/*.ts' --quiet --fix", + "tsc": "tsc", + "dev": "ts-node-dev --respawn --transpileOnly ./app/app.ts", + "prod": "tsc && node ./build/app.js" }, "author": "Adhiraj Singh", "license": "MIT", - "publishConfig": { "registry": "https://npm.pkg.github.com/" }, + "repository": { + "url": "git@github.com:adiwajshing/baileys.git" + }, "dependencies": { "curve25519-js": "0.0.4", "futoin-hkdf": "^1.3.2", "node-fetch": "^2.6.0", "protobufjs": "^6.9.0", "qrcode-terminal": "^0.12.0", - "sharp": "^0.25.3", - "video-thumb": "0.0.3", + "sharp": "^0.25.4", "ws": "^7.3.0" + }, + "devDependencies": { + "@types/mocha": "^7.0.2", + "@types/node": "^14.0.14", + "@types/sharp": "^0.25.0", + "@typescript-eslint/eslint-plugin": "^3.5.0", + "@typescript-eslint/parser": "^3.5.0", + "assert": "^2.0.0", + "eslint": "^7.3.1", + "eslint-config-prettier": "^6.11.0", + "eslint-plugin-prettier": "^3.1.4", + "mocha": "^8.0.1", + "prettier": "^2.0.5", + "ts-node-dev": "^1.0.0-pre.49", + "typescript": "^3.9.5" } }