UNPKG

@radzztnzx/rbail

Version:

Pro Bails based by Whiskeysockets, Modified by RadzzOffc

1,192 lines (1,077 loc) 3.84 MB
/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ import $protobuf from "protobufjs/minimal.js"; const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; const $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {}); export const proto = $root.proto = (() => { const proto = {}; proto.ADVDeviceIdentity = (function() { function ADVDeviceIdentity(p) { if (p) for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; } ADVDeviceIdentity.prototype.rawId = null; ADVDeviceIdentity.prototype.timestamp = null; ADVDeviceIdentity.prototype.keyIndex = null; ADVDeviceIdentity.prototype.accountType = null; ADVDeviceIdentity.prototype.deviceType = null; let $oneOfFields; // Virtual OneOf for proto3 optional field Object.defineProperty(ADVDeviceIdentity.prototype, "_rawId", { get: $util.oneOfGetter($oneOfFields = ["rawId"]), set: $util.oneOfSetter($oneOfFields) }); // Virtual OneOf for proto3 optional field Object.defineProperty(ADVDeviceIdentity.prototype, "_timestamp", { get: $util.oneOfGetter($oneOfFields = ["timestamp"]), set: $util.oneOfSetter($oneOfFields) }); // Virtual OneOf for proto3 optional field Object.defineProperty(ADVDeviceIdentity.prototype, "_keyIndex", { get: $util.oneOfGetter($oneOfFields = ["keyIndex"]), set: $util.oneOfSetter($oneOfFields) }); // Virtual OneOf for proto3 optional field Object.defineProperty(ADVDeviceIdentity.prototype, "_accountType", { get: $util.oneOfGetter($oneOfFields = ["accountType"]), set: $util.oneOfSetter($oneOfFields) }); // Virtual OneOf for proto3 optional field Object.defineProperty(ADVDeviceIdentity.prototype, "_deviceType", { get: $util.oneOfGetter($oneOfFields = ["deviceType"]), set: $util.oneOfSetter($oneOfFields) }); ADVDeviceIdentity.create = function create(properties) { return new ADVDeviceIdentity(properties); }; ADVDeviceIdentity.encode = function encode(m, w) { if (!w) w = $Writer.create(); if (m.rawId != null && Object.hasOwnProperty.call(m, "rawId")) w.uint32(8).uint32(m.rawId); if (m.timestamp != null && Object.hasOwnProperty.call(m, "timestamp")) w.uint32(16).uint64(m.timestamp); if (m.keyIndex != null && Object.hasOwnProperty.call(m, "keyIndex")) w.uint32(24).uint32(m.keyIndex); if (m.accountType != null && Object.hasOwnProperty.call(m, "accountType")) w.uint32(32).int32(m.accountType); if (m.deviceType != null && Object.hasOwnProperty.call(m, "deviceType")) w.uint32(40).int32(m.deviceType); return w; }; ADVDeviceIdentity.decode = function decode(r, l, e) { if (!(r instanceof $Reader)) r = $Reader.create(r); var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ADVDeviceIdentity(); while (r.pos < c) { var t = r.uint32(); if (t === e) break; switch (t >>> 3) { case 1: { m.rawId = r.uint32(); break; } case 2: { m.timestamp = r.uint64(); break; } case 3: { m.keyIndex = r.uint32(); break; } case 4: { m.accountType = r.int32(); break; } case 5: { m.deviceType = r.int32(); break; } default: r.skipType(t & 7); break; } } return m; }; ADVDeviceIdentity.fromObject = function fromObject(d) { if (d instanceof $root.proto.ADVDeviceIdentity) return d; var m = new $root.proto.ADVDeviceIdentity(); if (d.rawId != null) { m.rawId = d.rawId >>> 0; } if (d.timestamp != null) { if ($util.Long) (m.timestamp = $util.Long.fromValue(d.timestamp)).unsigned = true; else if (typeof d.timestamp === "string") m.timestamp = parseInt(d.timestamp, 10); else if (typeof d.timestamp === "number") m.timestamp = d.timestamp; else if (typeof d.timestamp === "object") m.timestamp = new $util.LongBits(d.timestamp.low >>> 0, d.timestamp.high >>> 0).toNumber(true); } if (d.keyIndex != null) { m.keyIndex = d.keyIndex >>> 0; } switch (d.accountType) { default: if (typeof d.accountType === "number") { m.accountType = d.accountType; break; } break; case "E2EE": case 0: m.accountType = 0; break; case "HOSTED": case 1: m.accountType = 1; break; } switch (d.deviceType) { default: if (typeof d.deviceType === "number") { m.deviceType = d.deviceType; break; } break; case "E2EE": case 0: m.deviceType = 0; break; case "HOSTED": case 1: m.deviceType = 1; break; } return m; }; ADVDeviceIdentity.toObject = function toObject(m, o) { if (!o) o = {}; var d = {}; if (m.rawId != null && m.hasOwnProperty("rawId")) { d.rawId = m.rawId; if (o.oneofs) d._rawId = "rawId"; } if (m.timestamp != null && m.hasOwnProperty("timestamp")) { if (typeof m.timestamp === "number") d.timestamp = o.longs === String ? String(m.timestamp) : m.timestamp; else d.timestamp = o.longs === String ? $util.Long.prototype.toString.call(m.timestamp) : o.longs === Number ? new $util.LongBits(m.timestamp.low >>> 0, m.timestamp.high >>> 0).toNumber(true) : m.timestamp; if (o.oneofs) d._timestamp = "timestamp"; } if (m.keyIndex != null && m.hasOwnProperty("keyIndex")) { d.keyIndex = m.keyIndex; if (o.oneofs) d._keyIndex = "keyIndex"; } if (m.accountType != null && m.hasOwnProperty("accountType")) { d.accountType = o.enums === String ? $root.proto.ADVEncryptionType[m.accountType] === undefined ? m.accountType : $root.proto.ADVEncryptionType[m.accountType] : m.accountType; if (o.oneofs) d._accountType = "accountType"; } if (m.deviceType != null && m.hasOwnProperty("deviceType")) { d.deviceType = o.enums === String ? $root.proto.ADVEncryptionType[m.deviceType] === undefined ? m.deviceType : $root.proto.ADVEncryptionType[m.deviceType] : m.deviceType; if (o.oneofs) d._deviceType = "deviceType"; } return d; }; ADVDeviceIdentity.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; ADVDeviceIdentity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } return typeUrlPrefix + "/proto.ADVDeviceIdentity"; }; return ADVDeviceIdentity; })(); proto.ADVEncryptionType = (function() { const valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "E2EE"] = 0; values[valuesById[1] = "HOSTED"] = 1; return values; })(); proto.ADVKeyIndexList = (function() { function ADVKeyIndexList(p) { this.validIndexes = []; if (p) for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; } ADVKeyIndexList.prototype.rawId = null; ADVKeyIndexList.prototype.timestamp = null; ADVKeyIndexList.prototype.currentIndex = null; ADVKeyIndexList.prototype.validIndexes = $util.emptyArray; ADVKeyIndexList.prototype.accountType = null; let $oneOfFields; // Virtual OneOf for proto3 optional field Object.defineProperty(ADVKeyIndexList.prototype, "_rawId", { get: $util.oneOfGetter($oneOfFields = ["rawId"]), set: $util.oneOfSetter($oneOfFields) }); // Virtual OneOf for proto3 optional field Object.defineProperty(ADVKeyIndexList.prototype, "_timestamp", { get: $util.oneOfGetter($oneOfFields = ["timestamp"]), set: $util.oneOfSetter($oneOfFields) }); // Virtual OneOf for proto3 optional field Object.defineProperty(ADVKeyIndexList.prototype, "_currentIndex", { get: $util.oneOfGetter($oneOfFields = ["currentIndex"]), set: $util.oneOfSetter($oneOfFields) }); // Virtual OneOf for proto3 optional field Object.defineProperty(ADVKeyIndexList.prototype, "_accountType", { get: $util.oneOfGetter($oneOfFields = ["accountType"]), set: $util.oneOfSetter($oneOfFields) }); ADVKeyIndexList.create = function create(properties) { return new ADVKeyIndexList(properties); }; ADVKeyIndexList.encode = function encode(m, w) { if (!w) w = $Writer.create(); if (m.rawId != null && Object.hasOwnProperty.call(m, "rawId")) w.uint32(8).uint32(m.rawId); if (m.timestamp != null && Object.hasOwnProperty.call(m, "timestamp")) w.uint32(16).uint64(m.timestamp); if (m.currentIndex != null && Object.hasOwnProperty.call(m, "currentIndex")) w.uint32(24).uint32(m.currentIndex); if (m.validIndexes != null && m.validIndexes.length) { w.uint32(34).fork(); for (var i = 0; i < m.validIndexes.length; ++i) w.uint32(m.validIndexes[i]); w.ldelim(); } if (m.accountType != null && Object.hasOwnProperty.call(m, "accountType")) w.uint32(40).int32(m.accountType); return w; }; ADVKeyIndexList.decode = function decode(r, l, e) { if (!(r instanceof $Reader)) r = $Reader.create(r); var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ADVKeyIndexList(); while (r.pos < c) { var t = r.uint32(); if (t === e) break; switch (t >>> 3) { case 1: { m.rawId = r.uint32(); break; } case 2: { m.timestamp = r.uint64(); break; } case 3: { m.currentIndex = r.uint32(); break; } case 4: { if (!(m.validIndexes && m.validIndexes.length)) m.validIndexes = []; if ((t & 7) === 2) { var c2 = r.uint32() + r.pos; while (r.pos < c2) m.validIndexes.push(r.uint32()); } else m.validIndexes.push(r.uint32()); break; } case 5: { m.accountType = r.int32(); break; } default: r.skipType(t & 7); break; } } return m; }; ADVKeyIndexList.fromObject = function fromObject(d) { if (d instanceof $root.proto.ADVKeyIndexList) return d; var m = new $root.proto.ADVKeyIndexList(); if (d.rawId != null) { m.rawId = d.rawId >>> 0; } if (d.timestamp != null) { if ($util.Long) (m.timestamp = $util.Long.fromValue(d.timestamp)).unsigned = true; else if (typeof d.timestamp === "string") m.timestamp = parseInt(d.timestamp, 10); else if (typeof d.timestamp === "number") m.timestamp = d.timestamp; else if (typeof d.timestamp === "object") m.timestamp = new $util.LongBits(d.timestamp.low >>> 0, d.timestamp.high >>> 0).toNumber(true); } if (d.currentIndex != null) { m.currentIndex = d.currentIndex >>> 0; } if (d.validIndexes) { if (!Array.isArray(d.validIndexes)) throw TypeError(".proto.ADVKeyIndexList.validIndexes: array expected"); m.validIndexes = []; for (var i = 0; i < d.validIndexes.length; ++i) { m.validIndexes[i] = d.validIndexes[i] >>> 0; } } switch (d.accountType) { default: if (typeof d.accountType === "number") { m.accountType = d.accountType; break; } break; case "E2EE": case 0: m.accountType = 0; break; case "HOSTED": case 1: m.accountType = 1; break; } return m; }; ADVKeyIndexList.toObject = function toObject(m, o) { if (!o) o = {}; var d = {}; if (o.arrays || o.defaults) { d.validIndexes = []; } if (m.rawId != null && m.hasOwnProperty("rawId")) { d.rawId = m.rawId; if (o.oneofs) d._rawId = "rawId"; } if (m.timestamp != null && m.hasOwnProperty("timestamp")) { if (typeof m.timestamp === "number") d.timestamp = o.longs === String ? String(m.timestamp) : m.timestamp; else d.timestamp = o.longs === String ? $util.Long.prototype.toString.call(m.timestamp) : o.longs === Number ? new $util.LongBits(m.timestamp.low >>> 0, m.timestamp.high >>> 0).toNumber(true) : m.timestamp; if (o.oneofs) d._timestamp = "timestamp"; } if (m.currentIndex != null && m.hasOwnProperty("currentIndex")) { d.currentIndex = m.currentIndex; if (o.oneofs) d._currentIndex = "currentIndex"; } if (m.validIndexes && m.validIndexes.length) { d.validIndexes = []; for (var j = 0; j < m.validIndexes.length; ++j) { d.validIndexes[j] = m.validIndexes[j]; } } if (m.accountType != null && m.hasOwnProperty("accountType")) { d.accountType = o.enums === String ? $root.proto.ADVEncryptionType[m.accountType] === undefined ? m.accountType : $root.proto.ADVEncryptionType[m.accountType] : m.accountType; if (o.oneofs) d._accountType = "accountType"; } return d; }; ADVKeyIndexList.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; ADVKeyIndexList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } return typeUrlPrefix + "/proto.ADVKeyIndexList"; }; return ADVKeyIndexList; })(); proto.ADVSignedDeviceIdentity = (function() { function ADVSignedDeviceIdentity(p) { if (p) for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; } ADVSignedDeviceIdentity.prototype.details = null; ADVSignedDeviceIdentity.prototype.accountSignatureKey = null; ADVSignedDeviceIdentity.prototype.accountSignature = null; ADVSignedDeviceIdentity.prototype.deviceSignature = null; let $oneOfFields; // Virtual OneOf for proto3 optional field Object.defineProperty(ADVSignedDeviceIdentity.prototype, "_details", { get: $util.oneOfGetter($oneOfFields = ["details"]), set: $util.oneOfSetter($oneOfFields) }); // Virtual OneOf for proto3 optional field Object.defineProperty(ADVSignedDeviceIdentity.prototype, "_accountSignatureKey", { get: $util.oneOfGetter($oneOfFields = ["accountSignatureKey"]), set: $util.oneOfSetter($oneOfFields) }); // Virtual OneOf for proto3 optional field Object.defineProperty(ADVSignedDeviceIdentity.prototype, "_accountSignature", { get: $util.oneOfGetter($oneOfFields = ["accountSignature"]), set: $util.oneOfSetter($oneOfFields) }); // Virtual OneOf for proto3 optional field Object.defineProperty(ADVSignedDeviceIdentity.prototype, "_deviceSignature", { get: $util.oneOfGetter($oneOfFields = ["deviceSignature"]), set: $util.oneOfSetter($oneOfFields) }); ADVSignedDeviceIdentity.create = function create(properties) { return new ADVSignedDeviceIdentity(properties); }; ADVSignedDeviceIdentity.encode = function encode(m, w) { if (!w) w = $Writer.create(); if (m.details != null && Object.hasOwnProperty.call(m, "details")) w.uint32(10).bytes(m.details); if (m.accountSignatureKey != null && Object.hasOwnProperty.call(m, "accountSignatureKey")) w.uint32(18).bytes(m.accountSignatureKey); if (m.accountSignature != null && Object.hasOwnProperty.call(m, "accountSignature")) w.uint32(26).bytes(m.accountSignature); if (m.deviceSignature != null && Object.hasOwnProperty.call(m, "deviceSignature")) w.uint32(34).bytes(m.deviceSignature); return w; }; ADVSignedDeviceIdentity.decode = function decode(r, l, e) { if (!(r instanceof $Reader)) r = $Reader.create(r); var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ADVSignedDeviceIdentity(); while (r.pos < c) { var t = r.uint32(); if (t === e) break; switch (t >>> 3) { case 1: { m.details = r.bytes(); break; } case 2: { m.accountSignatureKey = r.bytes(); break; } case 3: { m.accountSignature = r.bytes(); break; } case 4: { m.deviceSignature = r.bytes(); break; } default: r.skipType(t & 7); break; } } return m; }; ADVSignedDeviceIdentity.fromObject = function fromObject(d) { if (d instanceof $root.proto.ADVSignedDeviceIdentity) return d; var m = new $root.proto.ADVSignedDeviceIdentity(); if (d.details != null) { if (typeof d.details === "string") $util.base64.decode(d.details, m.details = $util.newBuffer($util.base64.length(d.details)), 0); else if (d.details.length >= 0) m.details = d.details; } if (d.accountSignatureKey != null) { if (typeof d.accountSignatureKey === "string") $util.base64.decode(d.accountSignatureKey, m.accountSignatureKey = $util.newBuffer($util.base64.length(d.accountSignatureKey)), 0); else if (d.accountSignatureKey.length >= 0) m.accountSignatureKey = d.accountSignatureKey; } if (d.accountSignature != null) { if (typeof d.accountSignature === "string") $util.base64.decode(d.accountSignature, m.accountSignature = $util.newBuffer($util.base64.length(d.accountSignature)), 0); else if (d.accountSignature.length >= 0) m.accountSignature = d.accountSignature; } if (d.deviceSignature != null) { if (typeof d.deviceSignature === "string") $util.base64.decode(d.deviceSignature, m.deviceSignature = $util.newBuffer($util.base64.length(d.deviceSignature)), 0); else if (d.deviceSignature.length >= 0) m.deviceSignature = d.deviceSignature; } return m; }; ADVSignedDeviceIdentity.toObject = function toObject(m, o) { if (!o) o = {}; var d = {}; if (m.details != null && m.hasOwnProperty("details")) { d.details = o.bytes === String ? $util.base64.encode(m.details, 0, m.details.length) : o.bytes === Array ? Array.prototype.slice.call(m.details) : m.details; if (o.oneofs) d._details = "details"; } if (m.accountSignatureKey != null && m.hasOwnProperty("accountSignatureKey")) { d.accountSignatureKey = o.bytes === String ? $util.base64.encode(m.accountSignatureKey, 0, m.accountSignatureKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.accountSignatureKey) : m.accountSignatureKey; if (o.oneofs) d._accountSignatureKey = "accountSignatureKey"; } if (m.accountSignature != null && m.hasOwnProperty("accountSignature")) { d.accountSignature = o.bytes === String ? $util.base64.encode(m.accountSignature, 0, m.accountSignature.length) : o.bytes === Array ? Array.prototype.slice.call(m.accountSignature) : m.accountSignature; if (o.oneofs) d._accountSignature = "accountSignature"; } if (m.deviceSignature != null && m.hasOwnProperty("deviceSignature")) { d.deviceSignature = o.bytes === String ? $util.base64.encode(m.deviceSignature, 0, m.deviceSignature.length) : o.bytes === Array ? Array.prototype.slice.call(m.deviceSignature) : m.deviceSignature; if (o.oneofs) d._deviceSignature = "deviceSignature"; } return d; }; ADVSignedDeviceIdentity.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; ADVSignedDeviceIdentity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } return typeUrlPrefix + "/proto.ADVSignedDeviceIdentity"; }; return ADVSignedDeviceIdentity; })(); proto.ADVSignedDeviceIdentityHMAC = (function() { function ADVSignedDeviceIdentityHMAC(p) { if (p) for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; } ADVSignedDeviceIdentityHMAC.prototype.details = null; ADVSignedDeviceIdentityHMAC.prototype.hmac = null; ADVSignedDeviceIdentityHMAC.prototype.accountType = null; let $oneOfFields; // Virtual OneOf for proto3 optional field Object.defineProperty(ADVSignedDeviceIdentityHMAC.prototype, "_details", { get: $util.oneOfGetter($oneOfFields = ["details"]), set: $util.oneOfSetter($oneOfFields) }); // Virtual OneOf for proto3 optional field Object.defineProperty(ADVSignedDeviceIdentityHMAC.prototype, "_hmac", { get: $util.oneOfGetter($oneOfFields = ["hmac"]), set: $util.oneOfSetter($oneOfFields) }); // Virtual OneOf for proto3 optional field Object.defineProperty(ADVSignedDeviceIdentityHMAC.prototype, "_accountType", { get: $util.oneOfGetter($oneOfFields = ["accountType"]), set: $util.oneOfSetter($oneOfFields) }); ADVSignedDeviceIdentityHMAC.create = function create(properties) { return new ADVSignedDeviceIdentityHMAC(properties); }; ADVSignedDeviceIdentityHMAC.encode = function encode(m, w) { if (!w) w = $Writer.create(); if (m.details != null && Object.hasOwnProperty.call(m, "details")) w.uint32(10).bytes(m.details); if (m.hmac != null && Object.hasOwnProperty.call(m, "hmac")) w.uint32(18).bytes(m.hmac); if (m.accountType != null && Object.hasOwnProperty.call(m, "accountType")) w.uint32(24).int32(m.accountType); return w; }; ADVSignedDeviceIdentityHMAC.decode = function decode(r, l, e) { if (!(r instanceof $Reader)) r = $Reader.create(r); var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ADVSignedDeviceIdentityHMAC(); while (r.pos < c) { var t = r.uint32(); if (t === e) break; switch (t >>> 3) { case 1: { m.details = r.bytes(); break; } case 2: { m.hmac = r.bytes(); break; } case 3: { m.accountType = r.int32(); break; } default: r.skipType(t & 7); break; } } return m; }; ADVSignedDeviceIdentityHMAC.fromObject = function fromObject(d) { if (d instanceof $root.proto.ADVSignedDeviceIdentityHMAC) return d; var m = new $root.proto.ADVSignedDeviceIdentityHMAC(); if (d.details != null) { if (typeof d.details === "string") $util.base64.decode(d.details, m.details = $util.newBuffer($util.base64.length(d.details)), 0); else if (d.details.length >= 0) m.details = d.details; } if (d.hmac != null) { if (typeof d.hmac === "string") $util.base64.decode(d.hmac, m.hmac = $util.newBuffer($util.base64.length(d.hmac)), 0); else if (d.hmac.length >= 0) m.hmac = d.hmac; } switch (d.accountType) { default: if (typeof d.accountType === "number") { m.accountType = d.accountType; break; } break; case "E2EE": case 0: m.accountType = 0; break; case "HOSTED": case 1: m.accountType = 1; break; } return m; }; ADVSignedDeviceIdentityHMAC.toObject = function toObject(m, o) { if (!o) o = {}; var d = {}; if (m.details != null && m.hasOwnProperty("details")) { d.details = o.bytes === String ? $util.base64.encode(m.details, 0, m.details.length) : o.bytes === Array ? Array.prototype.slice.call(m.details) : m.details; if (o.oneofs) d._details = "details"; } if (m.hmac != null && m.hasOwnProperty("hmac")) { d.hmac = o.bytes === String ? $util.base64.encode(m.hmac, 0, m.hmac.length) : o.bytes === Array ? Array.prototype.slice.call(m.hmac) : m.hmac; if (o.oneofs) d._hmac = "hmac"; } if (m.accountType != null && m.hasOwnProperty("accountType")) { d.accountType = o.enums === String ? $root.proto.ADVEncryptionType[m.accountType] === undefined ? m.accountType : $root.proto.ADVEncryptionType[m.accountType] : m.accountType; if (o.oneofs) d._accountType = "accountType"; } return d; }; ADVSignedDeviceIdentityHMAC.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; ADVSignedDeviceIdentityHMAC.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } return typeUrlPrefix + "/proto.ADVSignedDeviceIdentityHMAC"; }; return ADVSignedDeviceIdentityHMAC; })(); proto.ADVSignedKeyIndexList = (function() { function ADVSignedKeyIndexList(p) { if (p) for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; } ADVSignedKeyIndexList.prototype.details = null; ADVSignedKeyIndexList.prototype.accountSignature = null; ADVSignedKeyIndexList.prototype.accountSignatureKey = null; let $oneOfFields; // Virtual OneOf for proto3 optional field Object.defineProperty(ADVSignedKeyIndexList.prototype, "_details", { get: $util.oneOfGetter($oneOfFields = ["details"]), set: $util.oneOfSetter($oneOfFields) }); // Virtual OneOf for proto3 optional field Object.defineProperty(ADVSignedKeyIndexList.prototype, "_accountSignature", { get: $util.oneOfGetter($oneOfFields = ["accountSignature"]), set: $util.oneOfSetter($oneOfFields) }); // Virtual OneOf for proto3 optional field Object.defineProperty(ADVSignedKeyIndexList.prototype, "_accountSignatureKey", { get: $util.oneOfGetter($oneOfFields = ["accountSignatureKey"]), set: $util.oneOfSetter($oneOfFields) }); ADVSignedKeyIndexList.create = function create(properties) { return new ADVSignedKeyIndexList(properties); }; ADVSignedKeyIndexList.encode = function encode(m, w) { if (!w) w = $Writer.create(); if (m.details != null && Object.hasOwnProperty.call(m, "details")) w.uint32(10).bytes(m.details); if (m.accountSignature != null && Object.hasOwnProperty.call(m, "accountSignature")) w.uint32(18).bytes(m.accountSignature); if (m.accountSignatureKey != null && Object.hasOwnProperty.call(m, "accountSignatureKey")) w.uint32(26).bytes(m.accountSignatureKey); return w; }; ADVSignedKeyIndexList.decode = function decode(r, l, e) { if (!(r instanceof $Reader)) r = $Reader.create(r); var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ADVSignedKeyIndexList(); while (r.pos < c) { var t = r.uint32(); if (t === e) break; switch (t >>> 3) { case 1: { m.details = r.bytes(); break; } case 2: { m.accountSignature = r.bytes(); break; } case 3: { m.accountSignatureKey = r.bytes(); break; } default: r.skipType(t & 7); break; } } return m; }; ADVSignedKeyIndexList.fromObject = function fromObject(d) { if (d instanceof $root.proto.ADVSignedKeyIndexList) return d; var m = new $root.proto.ADVSignedKeyIndexList(); if (d.details != null) { if (typeof d.details === "string") $util.base64.decode(d.details, m.details = $util.newBuffer($util.base64.length(d.details)), 0); else if (d.details.length >= 0) m.details = d.details; } if (d.accountSignature != null) { if (typeof d.accountSignature === "string") $util.base64.decode(d.accountSignature, m.accountSignature = $util.newBuffer($util.base64.length(d.accountSignature)), 0); else if (d.accountSignature.length >= 0) m.accountSignature = d.accountSignature; } if (d.accountSignatureKey != null) { if (typeof d.accountSignatureKey === "string") $util.base64.decode(d.accountSignatureKey, m.accountSignatureKey = $util.newBuffer($util.base64.length(d.accountSignatureKey)), 0); else if (d.accountSignatureKey.length >= 0) m.accountSignatureKey = d.accountSignatureKey; } return m; }; ADVSignedKeyIndexList.toObject = function toObject(m, o) { if (!o) o = {}; var d = {}; if (m.details != null && m.hasOwnProperty("details")) { d.details = o.bytes === String ? $util.base64.encode(m.details, 0, m.details.length) : o.bytes === Array ? Array.prototype.slice.call(m.details) : m.details; if (o.oneofs) d._details = "details"; } if (m.accountSignature != null && m.hasOwnProperty("accountSignature")) { d.accountSignature = o.bytes === String ? $util.base64.encode(m.accountSignature, 0, m.accountSignature.length) : o.bytes === Array ? Array.prototype.slice.call(m.accountSignature) : m.accountSignature; if (o.oneofs) d._accountSignature = "accountSignature"; } if (m.accountSignatureKey != null && m.hasOwnProperty("accountSignatureKey")) { d.accountSignatureKey = o.bytes === String ? $util.base64.encode(m.accountSignatureKey, 0, m.accountSignatureKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.accountSignatureKey) : m.accountSignatureKey; if (o.oneofs) d._accountSignatureKey = "accountSignatureKey"; } return d; }; ADVSignedKeyIndexList.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; ADVSignedKeyIndexList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } return typeUrlPrefix + "/proto.ADVSignedKeyIndexList"; }; return ADVSignedKeyIndexList; })(); proto.AIQueryFanout = (function() { function AIQueryFanout(p) { if (p) for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; } AIQueryFanout.prototype.messageKey = null; AIQueryFanout.prototype.message = null; AIQueryFanout.prototype.timestamp = null; let $oneOfFields; // Virtual OneOf for proto3 optional field Object.defineProperty(AIQueryFanout.prototype, "_messageKey", { get: $util.oneOfGetter($oneOfFields = ["messageKey"]), set: $util.oneOfSetter($oneOfFields) }); // Virtual OneOf for proto3 optional field Object.defineProperty(AIQueryFanout.prototype, "_message", { get: $util.oneOfGetter($oneOfFields = ["message"]), set: $util.oneOfSetter($oneOfFields) }); // Virtual OneOf for proto3 optional field Object.defineProperty(AIQueryFanout.prototype, "_timestamp", { get: $util.oneOfGetter($oneOfFields = ["timestamp"]), set: $util.oneOfSetter($oneOfFields) }); AIQueryFanout.create = function create(properties) { return new AIQueryFanout(properties); }; AIQueryFanout.encode = function encode(m, w) { if (!w) w = $Writer.create(); if (m.messageKey != null && Object.hasOwnProperty.call(m, "messageKey")) $root.proto.MessageKey.encode(m.messageKey, w.uint32(10).fork()).ldelim(); if (m.message != null && Object.hasOwnProperty.call(m, "message")) $root.proto.Message.encode(m.message, w.uint32(18).fork()).ldelim(); if (m.timestamp != null && Object.hasOwnProperty.call(m, "timestamp")) w.uint32(24).int64(m.timestamp); return w; }; AIQueryFanout.decode = function decode(r, l, e) { if (!(r instanceof $Reader)) r = $Reader.create(r); var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AIQueryFanout(); while (r.pos < c) { var t = r.uint32(); if (t === e) break; switch (t >>> 3) { case 1: { m.messageKey = $root.proto.MessageKey.decode(r, r.uint32()); break; } case 2: { m.message = $root.proto.Message.decode(r, r.uint32()); break; } case 3: { m.timestamp = r.int64(); break; } default: r.skipType(t & 7); break; } } return m; }; AIQueryFanout.fromObject = function fromObject(d) { if (d instanceof $root.proto.AIQueryFanout) return d; var m = new $root.proto.AIQueryFanout(); if (d.messageKey != null) { if (typeof d.messageKey !== "object") throw TypeError(".proto.AIQueryFanout.messageKey: object expected"); m.messageKey = $root.proto.MessageKey.fromObject(d.messageKey); } if (d.message != null) { if (typeof d.message !== "object") throw TypeError(".proto.AIQueryFanout.message: object expected"); m.message = $root.proto.Message.fromObject(d.message); } if (d.timestamp != null) { if ($util.Long) (m.timestamp = $util.Long.fromValue(d.timestamp)).unsigned = false; else if (typeof d.timestamp === "string") m.timestamp = parseInt(d.timestamp, 10); else if (typeof d.timestamp === "number") m.timestamp = d.timestamp; else if (typeof d.timestamp === "object") m.timestamp = new $util.LongBits(d.timestamp.low >>> 0, d.timestamp.high >>> 0).toNumber(); } return m; }; AIQueryFanout.toObject = function toObject(m, o) { if (!o) o = {}; var d = {}; if (m.messageKey != null && m.hasOwnProperty("messageKey")) { d.messageKey = $root.proto.MessageKey.toObject(m.messageKey, o); if (o.oneofs) d._messageKey = "messageKey"; } if (m.message != null && m.hasOwnProperty("message")) { d.message = $root.proto.Message.toObject(m.message, o); if (o.oneofs) d._message = "message"; } if (m.timestamp != null && m.hasOwnProperty("timestamp")) { if (typeof m.timestamp === "number") d.timestamp = o.longs === String ? String(m.timestamp) : m.timestamp; else d.timestamp = o.longs === String ? $util.Long.prototype.toString.call(m.timestamp) : o.longs === Number ? new $util.LongBits(m.timestamp.low >>> 0, m.timestamp.high >>> 0).toNumber() : m.timestamp; if (o.oneofs) d._timestamp = "timestamp"; } return d; }; AIQueryFanout.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; AIQueryFanout.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } return typeUrlPrefix + "/proto.AIQueryFanout"; }; return AIQueryFanout; })(); proto.AIRichResponseMessage = (function() { function AIRichResponseMessage(p) { this.submessages = []; if (p) for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; } AIRichResponseMessage.prototype.messageType = null; AIRichResponseMessage.prototype.submessages = $util.emptyArray; AIRichResponseMessage.prototype.unifiedResponse = null; let $oneOfFields; // Virtual OneOf for proto3 optional field Object.defineProperty(AIRichResponseMessage.prototype, "_messageType", { get: $util.oneOfGetter($oneOfFields = ["messageType"]), set: $util.oneOfSetter($oneOfFields) }); // Virtual OneOf for proto3 optional field Object.defineProperty(AIRichResponseMessage.prototype, "_unifiedResponse", { get: $util.oneOfGetter($oneOfFields = ["unifiedResponse"]), set: $util.oneOfSetter($oneOfFields) }); AIRichResponseMessage.create = function create(properties) { return new AIRichResponseMessage(properties); }; AIRichResponseMessage.encode = function encode(m, w) { if (!w) w = $Writer.create(); if (m.messageType != null && Object.hasOwnProperty.call(m, "messageType")) w.uint32(8).int32(m.messageType); if (m.submessages != null && m.submessages.length) { for (var i = 0; i < m.submessages.length; ++i) $root.proto.AIRichResponseMessage.AIRichResponseSubMessage.encode(m.submessages[i], w.uint32(18).fork()).ldelim(); } if (m.unifiedResponse != null && Object.hasOwnProperty.call(m, "unifiedResponse")) $root.proto.AIRichResponseMessage.AIRichResponseUnifiedResponse.encode(m.unifiedResponse, w.uint32(26).fork()).ldelim(); return w; }; AIRichResponseMessage.decode = function decode(r, l, e) { if (!(r instanceof $Reader)) r = $Reader.create(r); var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AIRichResponseMessage(); while (r.pos < c) { var t = r.uint32(); if (t === e) break; switch (t >>> 3) { case 1: { m.messageType = r.int32(); break; } case 2: { if (!(m.submessages && m.submessages.length)) m.submessages = []; m.submessages.push($root.proto.AIRichResponseMessage.AIRichResponseSubMessage.decode(r, r.uint32())); break; } case 3: { m.unifiedResponse = $root.proto.AIRichResponseMessage.AIRichResponseUnifiedResponse.decode(r, r.uint32()); break; } default: r.skipType(t & 7); break; } } return m; }; AIRichResponseMessage.fromObject = function fromObject(d) { if (d instanceof $root.proto.AIRichResponseMessage) return d; var m = new $root.proto.AIRichResponseMessage(); switch (d.messageType) { default: if (typeof d.messageType === "number") { m.messageType = d.messageType; break; } break; case "AI_RICH_RESPONSE_TYPE_UNKNOWN": case 0: m.messageType = 0; break; case "AI_RICH_RESPONSE_TYPE_STANDARD": case 1: m.messageType = 1; break; } if (d.submessages) { if (!Array.isArray(d.submessages)) throw TypeError(".proto.AIRichResponseMessage.submessages: array expected"); m.submessages = []; for (var i = 0; i < d.submessages.length; ++i) { if (typeof d.submessages[i] !== "object") throw TypeError(".proto.AIRichResponseMessage.submessages: object expected"); m.submessages[i] = $root.proto.AIRichResponseMessage.AIRichResponseSubMessage.fromObject(d.submessages[i]); } } if (d.unifiedResponse != null) { if (typeof d.unifiedResponse !== "object") throw TypeError(".proto.AIRichResponseMessage.unifiedResponse: object expected"); m.unifiedResponse = $root.proto.AIRichResponseMessage.AIRichResponseUnifiedResponse.fromObject(d.unifiedResponse); } return m; }; AIRichResponseMessage.toObject = function toObject(m, o) { if (!o) o = {}; var d = {}; if (o.arrays || o.defaults) { d.submessages = []; } if (m.messageType != null && m.hasOwnProperty("messageType")) { d.messageType = o.enums === String ? $root.proto.AIRichResponseMessage.AIRichResponseMessageType[m.messageType] === undefined ? m.messageType : $root.proto.AIRichResponseMessage.AIRichResponseMessageType[m.messageType] : m.messageType; if (o.oneofs) d._messageType = "messageType"; } if (m.submessages && m.submessages.length) { d.submessages = []; for (var j = 0; j < m.submessages.length; ++j) { d.submessages[j] = $root.proto.AIRichResponseMessage.AIRichResponseSubMessage.toObject(m.submessages[j], o); } } if (m.unifiedResponse != null && m.hasOwnProperty("unifiedResponse")) { d.unifiedResponse = $root.proto.AIRichResponseMessage.AIRichResponseUnifiedResponse.toObject(m.unifiedResponse, o); if (o.oneofs) d._unifiedResponse = "unifiedResponse"; } return d; }; AIRichResponseMessage.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; AIRichResponseMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } return typeUrlPrefix + "/proto.AIRichResponseMessage"; }; AIRichResponseMessage.AIRichResponseCodeMetadata = (function() { function AIRichResponseCodeMetadata(p) { this.codeBlocks = []; if (p) for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) if (p[ks[i]] != null) this[ks[i]] = p[ks[i]];