New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@xmtp/proto

Package Overview
Dependencies
Maintainers
7
Versions
141
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@xmtp/proto - npm Package Compare versions

Comparing version 3.67.0 to 3.67.1

2

package.json
{
"name": "@xmtp/proto",
"version": "3.67.0",
"version": "3.67.1",
"description": "Protobuf client and generated classes for GRPC API",

@@ -5,0 +5,0 @@ "main": "./ts/dist/cjs/node.js",

@@ -26,3 +26,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.mlsValidationService = exports.mlsTranscriptMessages = exports.mlsGroupMutableMetadata = exports.mlsGroupMetadata = exports.mlsGroupMembership = exports.mlsCredential = exports.mlsContent = exports.mlsAssociation = exports.mlsDatabaseIntent = exports.mlsApi = exports.ecies = exports.signedPayload = exports.privatePreferences = exports.keystore = exports.invitation = exports.contact = exports.ciphertext = exports.signature = exports.publicKey = exports.privateKey = exports.composite = exports.conversationReference = exports.frames = exports.content = exports.message = exports.authn = exports.fetcher = exports.messageApi = void 0;
exports.mlsValidationService = exports.mlsTranscriptMessages = exports.mlsGroupMutableMetadata = exports.mlsGroupMetadata = exports.mlsGroupMembership = exports.mlsContent = exports.mlsDatabaseIntent = exports.mlsApi = exports.ecies = exports.signedPayload = exports.privatePreferences = exports.keystore = exports.invitation = exports.contact = exports.ciphertext = exports.signature = exports.publicKey = exports.privateKey = exports.composite = exports.conversationReference = exports.frames = exports.content = exports.message = exports.authn = exports.fetcher = exports.messageApi = void 0;
exports.messageApi = __importStar(require("./message_api/v1/message_api.pb"));

@@ -48,5 +48,3 @@ exports.fetcher = __importStar(require("./fetch.pb"));

exports.mlsDatabaseIntent = __importStar(require("./mls/database/intents.pb"));
exports.mlsAssociation = __importStar(require("./mls/message_contents/association.pb"));
exports.mlsContent = __importStar(require("./mls/message_contents/content.pb"));
exports.mlsCredential = __importStar(require("./mls/message_contents/credential.pb"));
exports.mlsGroupMembership = __importStar(require("./mls/message_contents/group_membership.pb"));

@@ -53,0 +51,0 @@ exports.mlsGroupMetadata = __importStar(require("./mls/message_contents/group_metadata.pb"));

@@ -6,3 +6,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.ValidationApiClientImpl = exports.ValidateInboxIdsResponse_ValidationResponse = exports.ValidateInboxIdsResponse = exports.ValidateInboxIdsRequest_ValidationRequest = exports.ValidateInboxIdsRequest = exports.GetAssociationStateResponse = exports.GetAssociationStateRequest = exports.ValidateGroupMessagesResponse_ValidationResponse = exports.ValidateGroupMessagesResponse = exports.ValidateGroupMessagesRequest_GroupMessage = exports.ValidateGroupMessagesRequest = exports.ValidateKeyPackagesResponse_ValidationResponse = exports.ValidateKeyPackagesResponse = exports.ValidateKeyPackagesRequest_KeyPackage = exports.ValidateKeyPackagesRequest = exports.ValidateInboxIdKeyPackagesResponse_Response = exports.ValidateInboxIdKeyPackagesResponse = exports.protobufPackage = void 0;
exports.ValidationApiClientImpl = exports.GetAssociationStateResponse = exports.GetAssociationStateRequest = exports.ValidateGroupMessagesResponse_ValidationResponse = exports.ValidateGroupMessagesResponse = exports.ValidateGroupMessagesRequest_GroupMessage = exports.ValidateGroupMessagesRequest = exports.ValidateInboxIdKeyPackagesResponse_Response = exports.ValidateInboxIdKeyPackagesResponse = exports.ValidateInboxIdKeyPackagesRequest_KeyPackage = exports.ValidateInboxIdKeyPackagesRequest = exports.protobufPackage = void 0;
/* eslint-disable */

@@ -14,170 +14,9 @@ const long_1 = __importDefault(require("long"));

exports.protobufPackage = "xmtp.mls_validation.v1";
function createBaseValidateInboxIdKeyPackagesResponse() {
return { responses: [] };
}
exports.ValidateInboxIdKeyPackagesResponse = {
encode(message, writer = minimal_1.default.Writer.create()) {
for (const v of message.responses) {
exports.ValidateInboxIdKeyPackagesResponse_Response.encode(v, writer.uint32(10).fork()).ldelim();
}
return writer;
},
decode(input, length) {
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseValidateInboxIdKeyPackagesResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.responses.push(exports.ValidateInboxIdKeyPackagesResponse_Response.decode(reader, reader.uint32()));
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object) {
return {
responses: Array.isArray(object === null || object === void 0 ? void 0 : object.responses)
? object.responses.map((e) => exports.ValidateInboxIdKeyPackagesResponse_Response.fromJSON(e))
: [],
};
},
toJSON(message) {
const obj = {};
if (message.responses) {
obj.responses = message.responses.map((e) => e ? exports.ValidateInboxIdKeyPackagesResponse_Response.toJSON(e) : undefined);
}
else {
obj.responses = [];
}
return obj;
},
fromPartial(object) {
var _a;
const message = createBaseValidateInboxIdKeyPackagesResponse();
message.responses =
((_a = object.responses) === null || _a === void 0 ? void 0 : _a.map((e) => exports.ValidateInboxIdKeyPackagesResponse_Response.fromPartial(e))) || [];
return message;
},
};
function createBaseValidateInboxIdKeyPackagesResponse_Response() {
return {
isOk: false,
errorMessage: "",
credential: undefined,
installationPublicKey: new Uint8Array(),
expiration: long_1.default.UZERO,
};
}
exports.ValidateInboxIdKeyPackagesResponse_Response = {
encode(message, writer = minimal_1.default.Writer.create()) {
if (message.isOk === true) {
writer.uint32(8).bool(message.isOk);
}
if (message.errorMessage !== "") {
writer.uint32(18).string(message.errorMessage);
}
if (message.credential !== undefined) {
credential_pb_1.MlsCredential.encode(message.credential, writer.uint32(26).fork()).ldelim();
}
if (message.installationPublicKey.length !== 0) {
writer.uint32(34).bytes(message.installationPublicKey);
}
if (!message.expiration.isZero()) {
writer.uint32(40).uint64(message.expiration);
}
return writer;
},
decode(input, length) {
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseValidateInboxIdKeyPackagesResponse_Response();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.isOk = reader.bool();
break;
case 2:
message.errorMessage = reader.string();
break;
case 3:
message.credential = credential_pb_1.MlsCredential.decode(reader, reader.uint32());
break;
case 4:
message.installationPublicKey = reader.bytes();
break;
case 5:
message.expiration = reader.uint64();
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object) {
return {
isOk: isSet(object.isOk) ? Boolean(object.isOk) : false,
errorMessage: isSet(object.errorMessage)
? String(object.errorMessage)
: "",
credential: isSet(object.credential)
? credential_pb_1.MlsCredential.fromJSON(object.credential)
: undefined,
installationPublicKey: isSet(object.installationPublicKey)
? bytesFromBase64(object.installationPublicKey)
: new Uint8Array(),
expiration: isSet(object.expiration)
? long_1.default.fromValue(object.expiration)
: long_1.default.UZERO,
};
},
toJSON(message) {
const obj = {};
message.isOk !== undefined && (obj.isOk = message.isOk);
message.errorMessage !== undefined &&
(obj.errorMessage = message.errorMessage);
message.credential !== undefined &&
(obj.credential = message.credential
? credential_pb_1.MlsCredential.toJSON(message.credential)
: undefined);
message.installationPublicKey !== undefined &&
(obj.installationPublicKey = base64FromBytes(message.installationPublicKey !== undefined
? message.installationPublicKey
: new Uint8Array()));
message.expiration !== undefined &&
(obj.expiration = (message.expiration || long_1.default.UZERO).toString());
return obj;
},
fromPartial(object) {
var _a, _b, _c;
const message = createBaseValidateInboxIdKeyPackagesResponse_Response();
message.isOk = (_a = object.isOk) !== null && _a !== void 0 ? _a : false;
message.errorMessage = (_b = object.errorMessage) !== null && _b !== void 0 ? _b : "";
message.credential =
object.credential !== undefined && object.credential !== null
? credential_pb_1.MlsCredential.fromPartial(object.credential)
: undefined;
message.installationPublicKey =
(_c = object.installationPublicKey) !== null && _c !== void 0 ? _c : new Uint8Array();
message.expiration =
object.expiration !== undefined && object.expiration !== null
? long_1.default.fromValue(object.expiration)
: long_1.default.UZERO;
return message;
},
};
function createBaseValidateKeyPackagesRequest() {
function createBaseValidateInboxIdKeyPackagesRequest() {
return { keyPackages: [] };
}
exports.ValidateKeyPackagesRequest = {
exports.ValidateInboxIdKeyPackagesRequest = {
encode(message, writer = minimal_1.default.Writer.create()) {
for (const v of message.keyPackages) {
exports.ValidateKeyPackagesRequest_KeyPackage.encode(v, writer.uint32(10).fork()).ldelim();
exports.ValidateInboxIdKeyPackagesRequest_KeyPackage.encode(v, writer.uint32(10).fork()).ldelim();
}

@@ -189,3 +28,3 @@ return writer;

let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseValidateKeyPackagesRequest();
const message = createBaseValidateInboxIdKeyPackagesRequest();
while (reader.pos < end) {

@@ -195,3 +34,3 @@ const tag = reader.uint32();

case 1:
message.keyPackages.push(exports.ValidateKeyPackagesRequest_KeyPackage.decode(reader, reader.uint32()));
message.keyPackages.push(exports.ValidateInboxIdKeyPackagesRequest_KeyPackage.decode(reader, reader.uint32()));
break;

@@ -208,3 +47,3 @@ default:

keyPackages: Array.isArray(object === null || object === void 0 ? void 0 : object.keyPackages)
? object.keyPackages.map((e) => exports.ValidateKeyPackagesRequest_KeyPackage.fromJSON(e))
? object.keyPackages.map((e) => exports.ValidateInboxIdKeyPackagesRequest_KeyPackage.fromJSON(e))
: [],

@@ -216,3 +55,3 @@ };

if (message.keyPackages) {
obj.keyPackages = message.keyPackages.map((e) => e ? exports.ValidateKeyPackagesRequest_KeyPackage.toJSON(e) : undefined);
obj.keyPackages = message.keyPackages.map((e) => e ? exports.ValidateInboxIdKeyPackagesRequest_KeyPackage.toJSON(e) : undefined);
}

@@ -226,9 +65,9 @@ else {

var _a;
const message = createBaseValidateKeyPackagesRequest();
const message = createBaseValidateInboxIdKeyPackagesRequest();
message.keyPackages =
((_a = object.keyPackages) === null || _a === void 0 ? void 0 : _a.map((e) => exports.ValidateKeyPackagesRequest_KeyPackage.fromPartial(e))) || [];
((_a = object.keyPackages) === null || _a === void 0 ? void 0 : _a.map((e) => exports.ValidateInboxIdKeyPackagesRequest_KeyPackage.fromPartial(e))) || [];
return message;
},
};
function createBaseValidateKeyPackagesRequest_KeyPackage() {
function createBaseValidateInboxIdKeyPackagesRequest_KeyPackage() {
return {

@@ -239,3 +78,3 @@ keyPackageBytesTlsSerialized: new Uint8Array(),

}
exports.ValidateKeyPackagesRequest_KeyPackage = {
exports.ValidateInboxIdKeyPackagesRequest_KeyPackage = {
encode(message, writer = minimal_1.default.Writer.create()) {

@@ -253,3 +92,3 @@ if (message.keyPackageBytesTlsSerialized.length !== 0) {

let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseValidateKeyPackagesRequest_KeyPackage();
const message = createBaseValidateInboxIdKeyPackagesRequest_KeyPackage();
while (reader.pos < end) {

@@ -293,3 +132,3 @@ const tag = reader.uint32();

var _a, _b;
const message = createBaseValidateKeyPackagesRequest_KeyPackage();
const message = createBaseValidateInboxIdKeyPackagesRequest_KeyPackage();
message.keyPackageBytesTlsSerialized =

@@ -301,9 +140,9 @@ (_a = object.keyPackageBytesTlsSerialized) !== null && _a !== void 0 ? _a : new Uint8Array();

};
function createBaseValidateKeyPackagesResponse() {
function createBaseValidateInboxIdKeyPackagesResponse() {
return { responses: [] };
}
exports.ValidateKeyPackagesResponse = {
exports.ValidateInboxIdKeyPackagesResponse = {
encode(message, writer = minimal_1.default.Writer.create()) {
for (const v of message.responses) {
exports.ValidateKeyPackagesResponse_ValidationResponse.encode(v, writer.uint32(10).fork()).ldelim();
exports.ValidateInboxIdKeyPackagesResponse_Response.encode(v, writer.uint32(10).fork()).ldelim();
}

@@ -315,3 +154,3 @@ return writer;

let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseValidateKeyPackagesResponse();
const message = createBaseValidateInboxIdKeyPackagesResponse();
while (reader.pos < end) {

@@ -321,3 +160,3 @@ const tag = reader.uint32();

case 1:
message.responses.push(exports.ValidateKeyPackagesResponse_ValidationResponse.decode(reader, reader.uint32()));
message.responses.push(exports.ValidateInboxIdKeyPackagesResponse_Response.decode(reader, reader.uint32()));
break;

@@ -334,3 +173,3 @@ default:

responses: Array.isArray(object === null || object === void 0 ? void 0 : object.responses)
? object.responses.map((e) => exports.ValidateKeyPackagesResponse_ValidationResponse.fromJSON(e))
? object.responses.map((e) => exports.ValidateInboxIdKeyPackagesResponse_Response.fromJSON(e))
: [],

@@ -342,3 +181,3 @@ };

if (message.responses) {
obj.responses = message.responses.map((e) => e ? exports.ValidateKeyPackagesResponse_ValidationResponse.toJSON(e) : undefined);
obj.responses = message.responses.map((e) => e ? exports.ValidateInboxIdKeyPackagesResponse_Response.toJSON(e) : undefined);
}

@@ -352,19 +191,18 @@ else {

var _a;
const message = createBaseValidateKeyPackagesResponse();
const message = createBaseValidateInboxIdKeyPackagesResponse();
message.responses =
((_a = object.responses) === null || _a === void 0 ? void 0 : _a.map((e) => exports.ValidateKeyPackagesResponse_ValidationResponse.fromPartial(e))) || [];
((_a = object.responses) === null || _a === void 0 ? void 0 : _a.map((e) => exports.ValidateInboxIdKeyPackagesResponse_Response.fromPartial(e))) || [];
return message;
},
};
function createBaseValidateKeyPackagesResponse_ValidationResponse() {
function createBaseValidateInboxIdKeyPackagesResponse_Response() {
return {
isOk: false,
errorMessage: "",
installationId: new Uint8Array(),
accountAddress: "",
credentialIdentityBytes: new Uint8Array(),
credential: undefined,
installationPublicKey: new Uint8Array(),
expiration: long_1.default.UZERO,
};
}
exports.ValidateKeyPackagesResponse_ValidationResponse = {
exports.ValidateInboxIdKeyPackagesResponse_Response = {
encode(message, writer = minimal_1.default.Writer.create()) {

@@ -377,13 +215,10 @@ if (message.isOk === true) {

}
if (message.installationId.length !== 0) {
writer.uint32(26).bytes(message.installationId);
if (message.credential !== undefined) {
credential_pb_1.MlsCredential.encode(message.credential, writer.uint32(26).fork()).ldelim();
}
if (message.accountAddress !== "") {
writer.uint32(34).string(message.accountAddress);
if (message.installationPublicKey.length !== 0) {
writer.uint32(34).bytes(message.installationPublicKey);
}
if (message.credentialIdentityBytes.length !== 0) {
writer.uint32(42).bytes(message.credentialIdentityBytes);
}
if (!message.expiration.isZero()) {
writer.uint32(48).uint64(message.expiration);
writer.uint32(40).uint64(message.expiration);
}

@@ -395,3 +230,3 @@ return writer;

let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseValidateKeyPackagesResponse_ValidationResponse();
const message = createBaseValidateInboxIdKeyPackagesResponse_Response();
while (reader.pos < end) {

@@ -407,11 +242,8 @@ const tag = reader.uint32();

case 3:
message.installationId = reader.bytes();
message.credential = credential_pb_1.MlsCredential.decode(reader, reader.uint32());
break;
case 4:
message.accountAddress = reader.string();
message.installationPublicKey = reader.bytes();
break;
case 5:
message.credentialIdentityBytes = reader.bytes();
break;
case 6:
message.expiration = reader.uint64();

@@ -432,11 +264,8 @@ break;

: "",
installationId: isSet(object.installationId)
? bytesFromBase64(object.installationId)
credential: isSet(object.credential)
? credential_pb_1.MlsCredential.fromJSON(object.credential)
: undefined,
installationPublicKey: isSet(object.installationPublicKey)
? bytesFromBase64(object.installationPublicKey)
: new Uint8Array(),
accountAddress: isSet(object.accountAddress)
? String(object.accountAddress)
: "",
credentialIdentityBytes: isSet(object.credentialIdentityBytes)
? bytesFromBase64(object.credentialIdentityBytes)
: new Uint8Array(),
expiration: isSet(object.expiration)

@@ -452,12 +281,10 @@ ? long_1.default.fromValue(object.expiration)

(obj.errorMessage = message.errorMessage);
message.installationId !== undefined &&
(obj.installationId = base64FromBytes(message.installationId !== undefined
? message.installationId
message.credential !== undefined &&
(obj.credential = message.credential
? credential_pb_1.MlsCredential.toJSON(message.credential)
: undefined);
message.installationPublicKey !== undefined &&
(obj.installationPublicKey = base64FromBytes(message.installationPublicKey !== undefined
? message.installationPublicKey
: new Uint8Array()));
message.accountAddress !== undefined &&
(obj.accountAddress = message.accountAddress);
message.credentialIdentityBytes !== undefined &&
(obj.credentialIdentityBytes = base64FromBytes(message.credentialIdentityBytes !== undefined
? message.credentialIdentityBytes
: new Uint8Array()));
message.expiration !== undefined &&

@@ -468,10 +295,12 @@ (obj.expiration = (message.expiration || long_1.default.UZERO).toString());

fromPartial(object) {
var _a, _b, _c, _d, _e;
const message = createBaseValidateKeyPackagesResponse_ValidationResponse();
var _a, _b, _c;
const message = createBaseValidateInboxIdKeyPackagesResponse_Response();
message.isOk = (_a = object.isOk) !== null && _a !== void 0 ? _a : false;
message.errorMessage = (_b = object.errorMessage) !== null && _b !== void 0 ? _b : "";
message.installationId = (_c = object.installationId) !== null && _c !== void 0 ? _c : new Uint8Array();
message.accountAddress = (_d = object.accountAddress) !== null && _d !== void 0 ? _d : "";
message.credentialIdentityBytes =
(_e = object.credentialIdentityBytes) !== null && _e !== void 0 ? _e : new Uint8Array();
message.credential =
object.credential !== undefined && object.credential !== null
? credential_pb_1.MlsCredential.fromPartial(object.credential)
: undefined;
message.installationPublicKey =
(_c = object.installationPublicKey) !== null && _c !== void 0 ? _c : new Uint8Array();
message.expiration =

@@ -842,263 +671,5 @@ object.expiration !== undefined && object.expiration !== null

};
function createBaseValidateInboxIdsRequest() {
return { requests: [] };
}
exports.ValidateInboxIdsRequest = {
encode(message, writer = minimal_1.default.Writer.create()) {
for (const v of message.requests) {
exports.ValidateInboxIdsRequest_ValidationRequest.encode(v, writer.uint32(10).fork()).ldelim();
}
return writer;
},
decode(input, length) {
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseValidateInboxIdsRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.requests.push(exports.ValidateInboxIdsRequest_ValidationRequest.decode(reader, reader.uint32()));
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object) {
return {
requests: Array.isArray(object === null || object === void 0 ? void 0 : object.requests)
? object.requests.map((e) => exports.ValidateInboxIdsRequest_ValidationRequest.fromJSON(e))
: [],
};
},
toJSON(message) {
const obj = {};
if (message.requests) {
obj.requests = message.requests.map((e) => e ? exports.ValidateInboxIdsRequest_ValidationRequest.toJSON(e) : undefined);
}
else {
obj.requests = [];
}
return obj;
},
fromPartial(object) {
var _a;
const message = createBaseValidateInboxIdsRequest();
message.requests =
((_a = object.requests) === null || _a === void 0 ? void 0 : _a.map((e) => exports.ValidateInboxIdsRequest_ValidationRequest.fromPartial(e))) || [];
return message;
},
};
function createBaseValidateInboxIdsRequest_ValidationRequest() {
return {
credential: undefined,
installationPublicKey: new Uint8Array(),
identityUpdates: [],
};
}
exports.ValidateInboxIdsRequest_ValidationRequest = {
encode(message, writer = minimal_1.default.Writer.create()) {
if (message.credential !== undefined) {
credential_pb_1.MlsCredential.encode(message.credential, writer.uint32(10).fork()).ldelim();
}
if (message.installationPublicKey.length !== 0) {
writer.uint32(18).bytes(message.installationPublicKey);
}
for (const v of message.identityUpdates) {
association_pb_1.IdentityUpdate.encode(v, writer.uint32(26).fork()).ldelim();
}
return writer;
},
decode(input, length) {
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseValidateInboxIdsRequest_ValidationRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.credential = credential_pb_1.MlsCredential.decode(reader, reader.uint32());
break;
case 2:
message.installationPublicKey = reader.bytes();
break;
case 3:
message.identityUpdates.push(association_pb_1.IdentityUpdate.decode(reader, reader.uint32()));
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object) {
return {
credential: isSet(object.credential)
? credential_pb_1.MlsCredential.fromJSON(object.credential)
: undefined,
installationPublicKey: isSet(object.installationPublicKey)
? bytesFromBase64(object.installationPublicKey)
: new Uint8Array(),
identityUpdates: Array.isArray(object === null || object === void 0 ? void 0 : object.identityUpdates)
? object.identityUpdates.map((e) => association_pb_1.IdentityUpdate.fromJSON(e))
: [],
};
},
toJSON(message) {
const obj = {};
message.credential !== undefined &&
(obj.credential = message.credential
? credential_pb_1.MlsCredential.toJSON(message.credential)
: undefined);
message.installationPublicKey !== undefined &&
(obj.installationPublicKey = base64FromBytes(message.installationPublicKey !== undefined
? message.installationPublicKey
: new Uint8Array()));
if (message.identityUpdates) {
obj.identityUpdates = message.identityUpdates.map((e) => e ? association_pb_1.IdentityUpdate.toJSON(e) : undefined);
}
else {
obj.identityUpdates = [];
}
return obj;
},
fromPartial(object) {
var _a, _b;
const message = createBaseValidateInboxIdsRequest_ValidationRequest();
message.credential =
object.credential !== undefined && object.credential !== null
? credential_pb_1.MlsCredential.fromPartial(object.credential)
: undefined;
message.installationPublicKey =
(_a = object.installationPublicKey) !== null && _a !== void 0 ? _a : new Uint8Array();
message.identityUpdates =
((_b = object.identityUpdates) === null || _b === void 0 ? void 0 : _b.map((e) => association_pb_1.IdentityUpdate.fromPartial(e))) || [];
return message;
},
};
function createBaseValidateInboxIdsResponse() {
return { responses: [] };
}
exports.ValidateInboxIdsResponse = {
encode(message, writer = minimal_1.default.Writer.create()) {
for (const v of message.responses) {
exports.ValidateInboxIdsResponse_ValidationResponse.encode(v, writer.uint32(10).fork()).ldelim();
}
return writer;
},
decode(input, length) {
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseValidateInboxIdsResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.responses.push(exports.ValidateInboxIdsResponse_ValidationResponse.decode(reader, reader.uint32()));
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object) {
return {
responses: Array.isArray(object === null || object === void 0 ? void 0 : object.responses)
? object.responses.map((e) => exports.ValidateInboxIdsResponse_ValidationResponse.fromJSON(e))
: [],
};
},
toJSON(message) {
const obj = {};
if (message.responses) {
obj.responses = message.responses.map((e) => e ? exports.ValidateInboxIdsResponse_ValidationResponse.toJSON(e) : undefined);
}
else {
obj.responses = [];
}
return obj;
},
fromPartial(object) {
var _a;
const message = createBaseValidateInboxIdsResponse();
message.responses =
((_a = object.responses) === null || _a === void 0 ? void 0 : _a.map((e) => exports.ValidateInboxIdsResponse_ValidationResponse.fromPartial(e))) || [];
return message;
},
};
function createBaseValidateInboxIdsResponse_ValidationResponse() {
return { isOk: false, errorMessage: "", inboxId: "" };
}
exports.ValidateInboxIdsResponse_ValidationResponse = {
encode(message, writer = minimal_1.default.Writer.create()) {
if (message.isOk === true) {
writer.uint32(8).bool(message.isOk);
}
if (message.errorMessage !== "") {
writer.uint32(18).string(message.errorMessage);
}
if (message.inboxId !== "") {
writer.uint32(26).string(message.inboxId);
}
return writer;
},
decode(input, length) {
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseValidateInboxIdsResponse_ValidationResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.isOk = reader.bool();
break;
case 2:
message.errorMessage = reader.string();
break;
case 3:
message.inboxId = reader.string();
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object) {
return {
isOk: isSet(object.isOk) ? Boolean(object.isOk) : false,
errorMessage: isSet(object.errorMessage)
? String(object.errorMessage)
: "",
inboxId: isSet(object.inboxId) ? String(object.inboxId) : "",
};
},
toJSON(message) {
const obj = {};
message.isOk !== undefined && (obj.isOk = message.isOk);
message.errorMessage !== undefined &&
(obj.errorMessage = message.errorMessage);
message.inboxId !== undefined && (obj.inboxId = message.inboxId);
return obj;
},
fromPartial(object) {
var _a, _b, _c;
const message = createBaseValidateInboxIdsResponse_ValidationResponse();
message.isOk = (_a = object.isOk) !== null && _a !== void 0 ? _a : false;
message.errorMessage = (_b = object.errorMessage) !== null && _b !== void 0 ? _b : "";
message.inboxId = (_c = object.inboxId) !== null && _c !== void 0 ? _c : "";
return message;
},
};
class ValidationApiClientImpl {
constructor(rpc) {
this.rpc = rpc;
this.ValidateKeyPackages = this.ValidateKeyPackages.bind(this);
this.ValidateGroupMessages = this.ValidateGroupMessages.bind(this);

@@ -1108,9 +679,3 @@ this.GetAssociationState = this.GetAssociationState.bind(this);

this.ValidateInboxIdKeyPackages.bind(this);
this.ValidateInboxIds = this.ValidateInboxIds.bind(this);
}
ValidateKeyPackages(request) {
const data = exports.ValidateKeyPackagesRequest.encode(request).finish();
const promise = this.rpc.request("xmtp.mls_validation.v1.ValidationApi", "ValidateKeyPackages", data);
return promise.then((data) => exports.ValidateKeyPackagesResponse.decode(new minimal_1.default.Reader(data)));
}
ValidateGroupMessages(request) {

@@ -1127,11 +692,6 @@ const data = exports.ValidateGroupMessagesRequest.encode(request).finish();

ValidateInboxIdKeyPackages(request) {
const data = exports.ValidateKeyPackagesRequest.encode(request).finish();
const data = exports.ValidateInboxIdKeyPackagesRequest.encode(request).finish();
const promise = this.rpc.request("xmtp.mls_validation.v1.ValidationApi", "ValidateInboxIdKeyPackages", data);
return promise.then((data) => exports.ValidateInboxIdKeyPackagesResponse.decode(new minimal_1.default.Reader(data)));
}
ValidateInboxIds(request) {
const data = exports.ValidateInboxIdsRequest.encode(request).finish();
const promise = this.rpc.request("xmtp.mls_validation.v1.ValidationApi", "ValidateInboxIds", data);
return promise.then((data) => exports.ValidateInboxIdsResponse.decode(new minimal_1.default.Reader(data)));
}
}

@@ -1138,0 +698,0 @@ exports.ValidationApiClientImpl = ValidationApiClientImpl;

@@ -21,5 +21,3 @@ export * as messageApi from "./message_api/v1/message_api.pb";

export * as mlsDatabaseIntent from "./mls/database/intents.pb";
export * as mlsAssociation from "./mls/message_contents/association.pb";
export * as mlsContent from "./mls/message_contents/content.pb";
export * as mlsCredential from "./mls/message_contents/credential.pb";
export * as mlsGroupMembership from "./mls/message_contents/group_membership.pb";

@@ -26,0 +24,0 @@ export * as mlsGroupMetadata from "./mls/message_contents/group_metadata.pb";

@@ -7,170 +7,9 @@ /* eslint-disable */

export const protobufPackage = "xmtp.mls_validation.v1";
function createBaseValidateInboxIdKeyPackagesResponse() {
return { responses: [] };
}
export const ValidateInboxIdKeyPackagesResponse = {
encode(message, writer = _m0.Writer.create()) {
for (const v of message.responses) {
ValidateInboxIdKeyPackagesResponse_Response.encode(v, writer.uint32(10).fork()).ldelim();
}
return writer;
},
decode(input, length) {
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseValidateInboxIdKeyPackagesResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.responses.push(ValidateInboxIdKeyPackagesResponse_Response.decode(reader, reader.uint32()));
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object) {
return {
responses: Array.isArray(object === null || object === void 0 ? void 0 : object.responses)
? object.responses.map((e) => ValidateInboxIdKeyPackagesResponse_Response.fromJSON(e))
: [],
};
},
toJSON(message) {
const obj = {};
if (message.responses) {
obj.responses = message.responses.map((e) => e ? ValidateInboxIdKeyPackagesResponse_Response.toJSON(e) : undefined);
}
else {
obj.responses = [];
}
return obj;
},
fromPartial(object) {
var _a;
const message = createBaseValidateInboxIdKeyPackagesResponse();
message.responses =
((_a = object.responses) === null || _a === void 0 ? void 0 : _a.map((e) => ValidateInboxIdKeyPackagesResponse_Response.fromPartial(e))) || [];
return message;
},
};
function createBaseValidateInboxIdKeyPackagesResponse_Response() {
return {
isOk: false,
errorMessage: "",
credential: undefined,
installationPublicKey: new Uint8Array(),
expiration: Long.UZERO,
};
}
export const ValidateInboxIdKeyPackagesResponse_Response = {
encode(message, writer = _m0.Writer.create()) {
if (message.isOk === true) {
writer.uint32(8).bool(message.isOk);
}
if (message.errorMessage !== "") {
writer.uint32(18).string(message.errorMessage);
}
if (message.credential !== undefined) {
MlsCredential.encode(message.credential, writer.uint32(26).fork()).ldelim();
}
if (message.installationPublicKey.length !== 0) {
writer.uint32(34).bytes(message.installationPublicKey);
}
if (!message.expiration.isZero()) {
writer.uint32(40).uint64(message.expiration);
}
return writer;
},
decode(input, length) {
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseValidateInboxIdKeyPackagesResponse_Response();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.isOk = reader.bool();
break;
case 2:
message.errorMessage = reader.string();
break;
case 3:
message.credential = MlsCredential.decode(reader, reader.uint32());
break;
case 4:
message.installationPublicKey = reader.bytes();
break;
case 5:
message.expiration = reader.uint64();
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object) {
return {
isOk: isSet(object.isOk) ? Boolean(object.isOk) : false,
errorMessage: isSet(object.errorMessage)
? String(object.errorMessage)
: "",
credential: isSet(object.credential)
? MlsCredential.fromJSON(object.credential)
: undefined,
installationPublicKey: isSet(object.installationPublicKey)
? bytesFromBase64(object.installationPublicKey)
: new Uint8Array(),
expiration: isSet(object.expiration)
? Long.fromValue(object.expiration)
: Long.UZERO,
};
},
toJSON(message) {
const obj = {};
message.isOk !== undefined && (obj.isOk = message.isOk);
message.errorMessage !== undefined &&
(obj.errorMessage = message.errorMessage);
message.credential !== undefined &&
(obj.credential = message.credential
? MlsCredential.toJSON(message.credential)
: undefined);
message.installationPublicKey !== undefined &&
(obj.installationPublicKey = base64FromBytes(message.installationPublicKey !== undefined
? message.installationPublicKey
: new Uint8Array()));
message.expiration !== undefined &&
(obj.expiration = (message.expiration || Long.UZERO).toString());
return obj;
},
fromPartial(object) {
var _a, _b, _c;
const message = createBaseValidateInboxIdKeyPackagesResponse_Response();
message.isOk = (_a = object.isOk) !== null && _a !== void 0 ? _a : false;
message.errorMessage = (_b = object.errorMessage) !== null && _b !== void 0 ? _b : "";
message.credential =
object.credential !== undefined && object.credential !== null
? MlsCredential.fromPartial(object.credential)
: undefined;
message.installationPublicKey =
(_c = object.installationPublicKey) !== null && _c !== void 0 ? _c : new Uint8Array();
message.expiration =
object.expiration !== undefined && object.expiration !== null
? Long.fromValue(object.expiration)
: Long.UZERO;
return message;
},
};
function createBaseValidateKeyPackagesRequest() {
function createBaseValidateInboxIdKeyPackagesRequest() {
return { keyPackages: [] };
}
export const ValidateKeyPackagesRequest = {
export const ValidateInboxIdKeyPackagesRequest = {
encode(message, writer = _m0.Writer.create()) {
for (const v of message.keyPackages) {
ValidateKeyPackagesRequest_KeyPackage.encode(v, writer.uint32(10).fork()).ldelim();
ValidateInboxIdKeyPackagesRequest_KeyPackage.encode(v, writer.uint32(10).fork()).ldelim();
}

@@ -182,3 +21,3 @@ return writer;

let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseValidateKeyPackagesRequest();
const message = createBaseValidateInboxIdKeyPackagesRequest();
while (reader.pos < end) {

@@ -188,3 +27,3 @@ const tag = reader.uint32();

case 1:
message.keyPackages.push(ValidateKeyPackagesRequest_KeyPackage.decode(reader, reader.uint32()));
message.keyPackages.push(ValidateInboxIdKeyPackagesRequest_KeyPackage.decode(reader, reader.uint32()));
break;

@@ -201,3 +40,3 @@ default:

keyPackages: Array.isArray(object === null || object === void 0 ? void 0 : object.keyPackages)
? object.keyPackages.map((e) => ValidateKeyPackagesRequest_KeyPackage.fromJSON(e))
? object.keyPackages.map((e) => ValidateInboxIdKeyPackagesRequest_KeyPackage.fromJSON(e))
: [],

@@ -209,3 +48,3 @@ };

if (message.keyPackages) {
obj.keyPackages = message.keyPackages.map((e) => e ? ValidateKeyPackagesRequest_KeyPackage.toJSON(e) : undefined);
obj.keyPackages = message.keyPackages.map((e) => e ? ValidateInboxIdKeyPackagesRequest_KeyPackage.toJSON(e) : undefined);
}

@@ -219,9 +58,9 @@ else {

var _a;
const message = createBaseValidateKeyPackagesRequest();
const message = createBaseValidateInboxIdKeyPackagesRequest();
message.keyPackages =
((_a = object.keyPackages) === null || _a === void 0 ? void 0 : _a.map((e) => ValidateKeyPackagesRequest_KeyPackage.fromPartial(e))) || [];
((_a = object.keyPackages) === null || _a === void 0 ? void 0 : _a.map((e) => ValidateInboxIdKeyPackagesRequest_KeyPackage.fromPartial(e))) || [];
return message;
},
};
function createBaseValidateKeyPackagesRequest_KeyPackage() {
function createBaseValidateInboxIdKeyPackagesRequest_KeyPackage() {
return {

@@ -232,3 +71,3 @@ keyPackageBytesTlsSerialized: new Uint8Array(),

}
export const ValidateKeyPackagesRequest_KeyPackage = {
export const ValidateInboxIdKeyPackagesRequest_KeyPackage = {
encode(message, writer = _m0.Writer.create()) {

@@ -246,3 +85,3 @@ if (message.keyPackageBytesTlsSerialized.length !== 0) {

let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseValidateKeyPackagesRequest_KeyPackage();
const message = createBaseValidateInboxIdKeyPackagesRequest_KeyPackage();
while (reader.pos < end) {

@@ -286,3 +125,3 @@ const tag = reader.uint32();

var _a, _b;
const message = createBaseValidateKeyPackagesRequest_KeyPackage();
const message = createBaseValidateInboxIdKeyPackagesRequest_KeyPackage();
message.keyPackageBytesTlsSerialized =

@@ -294,9 +133,9 @@ (_a = object.keyPackageBytesTlsSerialized) !== null && _a !== void 0 ? _a : new Uint8Array();

};
function createBaseValidateKeyPackagesResponse() {
function createBaseValidateInboxIdKeyPackagesResponse() {
return { responses: [] };
}
export const ValidateKeyPackagesResponse = {
export const ValidateInboxIdKeyPackagesResponse = {
encode(message, writer = _m0.Writer.create()) {
for (const v of message.responses) {
ValidateKeyPackagesResponse_ValidationResponse.encode(v, writer.uint32(10).fork()).ldelim();
ValidateInboxIdKeyPackagesResponse_Response.encode(v, writer.uint32(10).fork()).ldelim();
}

@@ -308,3 +147,3 @@ return writer;

let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseValidateKeyPackagesResponse();
const message = createBaseValidateInboxIdKeyPackagesResponse();
while (reader.pos < end) {

@@ -314,3 +153,3 @@ const tag = reader.uint32();

case 1:
message.responses.push(ValidateKeyPackagesResponse_ValidationResponse.decode(reader, reader.uint32()));
message.responses.push(ValidateInboxIdKeyPackagesResponse_Response.decode(reader, reader.uint32()));
break;

@@ -327,3 +166,3 @@ default:

responses: Array.isArray(object === null || object === void 0 ? void 0 : object.responses)
? object.responses.map((e) => ValidateKeyPackagesResponse_ValidationResponse.fromJSON(e))
? object.responses.map((e) => ValidateInboxIdKeyPackagesResponse_Response.fromJSON(e))
: [],

@@ -335,3 +174,3 @@ };

if (message.responses) {
obj.responses = message.responses.map((e) => e ? ValidateKeyPackagesResponse_ValidationResponse.toJSON(e) : undefined);
obj.responses = message.responses.map((e) => e ? ValidateInboxIdKeyPackagesResponse_Response.toJSON(e) : undefined);
}

@@ -345,19 +184,18 @@ else {

var _a;
const message = createBaseValidateKeyPackagesResponse();
const message = createBaseValidateInboxIdKeyPackagesResponse();
message.responses =
((_a = object.responses) === null || _a === void 0 ? void 0 : _a.map((e) => ValidateKeyPackagesResponse_ValidationResponse.fromPartial(e))) || [];
((_a = object.responses) === null || _a === void 0 ? void 0 : _a.map((e) => ValidateInboxIdKeyPackagesResponse_Response.fromPartial(e))) || [];
return message;
},
};
function createBaseValidateKeyPackagesResponse_ValidationResponse() {
function createBaseValidateInboxIdKeyPackagesResponse_Response() {
return {
isOk: false,
errorMessage: "",
installationId: new Uint8Array(),
accountAddress: "",
credentialIdentityBytes: new Uint8Array(),
credential: undefined,
installationPublicKey: new Uint8Array(),
expiration: Long.UZERO,
};
}
export const ValidateKeyPackagesResponse_ValidationResponse = {
export const ValidateInboxIdKeyPackagesResponse_Response = {
encode(message, writer = _m0.Writer.create()) {

@@ -370,13 +208,10 @@ if (message.isOk === true) {

}
if (message.installationId.length !== 0) {
writer.uint32(26).bytes(message.installationId);
if (message.credential !== undefined) {
MlsCredential.encode(message.credential, writer.uint32(26).fork()).ldelim();
}
if (message.accountAddress !== "") {
writer.uint32(34).string(message.accountAddress);
if (message.installationPublicKey.length !== 0) {
writer.uint32(34).bytes(message.installationPublicKey);
}
if (message.credentialIdentityBytes.length !== 0) {
writer.uint32(42).bytes(message.credentialIdentityBytes);
}
if (!message.expiration.isZero()) {
writer.uint32(48).uint64(message.expiration);
writer.uint32(40).uint64(message.expiration);
}

@@ -388,3 +223,3 @@ return writer;

let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseValidateKeyPackagesResponse_ValidationResponse();
const message = createBaseValidateInboxIdKeyPackagesResponse_Response();
while (reader.pos < end) {

@@ -400,11 +235,8 @@ const tag = reader.uint32();

case 3:
message.installationId = reader.bytes();
message.credential = MlsCredential.decode(reader, reader.uint32());
break;
case 4:
message.accountAddress = reader.string();
message.installationPublicKey = reader.bytes();
break;
case 5:
message.credentialIdentityBytes = reader.bytes();
break;
case 6:
message.expiration = reader.uint64();

@@ -425,11 +257,8 @@ break;

: "",
installationId: isSet(object.installationId)
? bytesFromBase64(object.installationId)
credential: isSet(object.credential)
? MlsCredential.fromJSON(object.credential)
: undefined,
installationPublicKey: isSet(object.installationPublicKey)
? bytesFromBase64(object.installationPublicKey)
: new Uint8Array(),
accountAddress: isSet(object.accountAddress)
? String(object.accountAddress)
: "",
credentialIdentityBytes: isSet(object.credentialIdentityBytes)
? bytesFromBase64(object.credentialIdentityBytes)
: new Uint8Array(),
expiration: isSet(object.expiration)

@@ -445,12 +274,10 @@ ? Long.fromValue(object.expiration)

(obj.errorMessage = message.errorMessage);
message.installationId !== undefined &&
(obj.installationId = base64FromBytes(message.installationId !== undefined
? message.installationId
message.credential !== undefined &&
(obj.credential = message.credential
? MlsCredential.toJSON(message.credential)
: undefined);
message.installationPublicKey !== undefined &&
(obj.installationPublicKey = base64FromBytes(message.installationPublicKey !== undefined
? message.installationPublicKey
: new Uint8Array()));
message.accountAddress !== undefined &&
(obj.accountAddress = message.accountAddress);
message.credentialIdentityBytes !== undefined &&
(obj.credentialIdentityBytes = base64FromBytes(message.credentialIdentityBytes !== undefined
? message.credentialIdentityBytes
: new Uint8Array()));
message.expiration !== undefined &&

@@ -461,10 +288,12 @@ (obj.expiration = (message.expiration || Long.UZERO).toString());

fromPartial(object) {
var _a, _b, _c, _d, _e;
const message = createBaseValidateKeyPackagesResponse_ValidationResponse();
var _a, _b, _c;
const message = createBaseValidateInboxIdKeyPackagesResponse_Response();
message.isOk = (_a = object.isOk) !== null && _a !== void 0 ? _a : false;
message.errorMessage = (_b = object.errorMessage) !== null && _b !== void 0 ? _b : "";
message.installationId = (_c = object.installationId) !== null && _c !== void 0 ? _c : new Uint8Array();
message.accountAddress = (_d = object.accountAddress) !== null && _d !== void 0 ? _d : "";
message.credentialIdentityBytes =
(_e = object.credentialIdentityBytes) !== null && _e !== void 0 ? _e : new Uint8Array();
message.credential =
object.credential !== undefined && object.credential !== null
? MlsCredential.fromPartial(object.credential)
: undefined;
message.installationPublicKey =
(_c = object.installationPublicKey) !== null && _c !== void 0 ? _c : new Uint8Array();
message.expiration =

@@ -835,263 +664,5 @@ object.expiration !== undefined && object.expiration !== null

};
function createBaseValidateInboxIdsRequest() {
return { requests: [] };
}
export const ValidateInboxIdsRequest = {
encode(message, writer = _m0.Writer.create()) {
for (const v of message.requests) {
ValidateInboxIdsRequest_ValidationRequest.encode(v, writer.uint32(10).fork()).ldelim();
}
return writer;
},
decode(input, length) {
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseValidateInboxIdsRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.requests.push(ValidateInboxIdsRequest_ValidationRequest.decode(reader, reader.uint32()));
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object) {
return {
requests: Array.isArray(object === null || object === void 0 ? void 0 : object.requests)
? object.requests.map((e) => ValidateInboxIdsRequest_ValidationRequest.fromJSON(e))
: [],
};
},
toJSON(message) {
const obj = {};
if (message.requests) {
obj.requests = message.requests.map((e) => e ? ValidateInboxIdsRequest_ValidationRequest.toJSON(e) : undefined);
}
else {
obj.requests = [];
}
return obj;
},
fromPartial(object) {
var _a;
const message = createBaseValidateInboxIdsRequest();
message.requests =
((_a = object.requests) === null || _a === void 0 ? void 0 : _a.map((e) => ValidateInboxIdsRequest_ValidationRequest.fromPartial(e))) || [];
return message;
},
};
function createBaseValidateInboxIdsRequest_ValidationRequest() {
return {
credential: undefined,
installationPublicKey: new Uint8Array(),
identityUpdates: [],
};
}
export const ValidateInboxIdsRequest_ValidationRequest = {
encode(message, writer = _m0.Writer.create()) {
if (message.credential !== undefined) {
MlsCredential.encode(message.credential, writer.uint32(10).fork()).ldelim();
}
if (message.installationPublicKey.length !== 0) {
writer.uint32(18).bytes(message.installationPublicKey);
}
for (const v of message.identityUpdates) {
IdentityUpdate.encode(v, writer.uint32(26).fork()).ldelim();
}
return writer;
},
decode(input, length) {
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseValidateInboxIdsRequest_ValidationRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.credential = MlsCredential.decode(reader, reader.uint32());
break;
case 2:
message.installationPublicKey = reader.bytes();
break;
case 3:
message.identityUpdates.push(IdentityUpdate.decode(reader, reader.uint32()));
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object) {
return {
credential: isSet(object.credential)
? MlsCredential.fromJSON(object.credential)
: undefined,
installationPublicKey: isSet(object.installationPublicKey)
? bytesFromBase64(object.installationPublicKey)
: new Uint8Array(),
identityUpdates: Array.isArray(object === null || object === void 0 ? void 0 : object.identityUpdates)
? object.identityUpdates.map((e) => IdentityUpdate.fromJSON(e))
: [],
};
},
toJSON(message) {
const obj = {};
message.credential !== undefined &&
(obj.credential = message.credential
? MlsCredential.toJSON(message.credential)
: undefined);
message.installationPublicKey !== undefined &&
(obj.installationPublicKey = base64FromBytes(message.installationPublicKey !== undefined
? message.installationPublicKey
: new Uint8Array()));
if (message.identityUpdates) {
obj.identityUpdates = message.identityUpdates.map((e) => e ? IdentityUpdate.toJSON(e) : undefined);
}
else {
obj.identityUpdates = [];
}
return obj;
},
fromPartial(object) {
var _a, _b;
const message = createBaseValidateInboxIdsRequest_ValidationRequest();
message.credential =
object.credential !== undefined && object.credential !== null
? MlsCredential.fromPartial(object.credential)
: undefined;
message.installationPublicKey =
(_a = object.installationPublicKey) !== null && _a !== void 0 ? _a : new Uint8Array();
message.identityUpdates =
((_b = object.identityUpdates) === null || _b === void 0 ? void 0 : _b.map((e) => IdentityUpdate.fromPartial(e))) || [];
return message;
},
};
function createBaseValidateInboxIdsResponse() {
return { responses: [] };
}
export const ValidateInboxIdsResponse = {
encode(message, writer = _m0.Writer.create()) {
for (const v of message.responses) {
ValidateInboxIdsResponse_ValidationResponse.encode(v, writer.uint32(10).fork()).ldelim();
}
return writer;
},
decode(input, length) {
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseValidateInboxIdsResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.responses.push(ValidateInboxIdsResponse_ValidationResponse.decode(reader, reader.uint32()));
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object) {
return {
responses: Array.isArray(object === null || object === void 0 ? void 0 : object.responses)
? object.responses.map((e) => ValidateInboxIdsResponse_ValidationResponse.fromJSON(e))
: [],
};
},
toJSON(message) {
const obj = {};
if (message.responses) {
obj.responses = message.responses.map((e) => e ? ValidateInboxIdsResponse_ValidationResponse.toJSON(e) : undefined);
}
else {
obj.responses = [];
}
return obj;
},
fromPartial(object) {
var _a;
const message = createBaseValidateInboxIdsResponse();
message.responses =
((_a = object.responses) === null || _a === void 0 ? void 0 : _a.map((e) => ValidateInboxIdsResponse_ValidationResponse.fromPartial(e))) || [];
return message;
},
};
function createBaseValidateInboxIdsResponse_ValidationResponse() {
return { isOk: false, errorMessage: "", inboxId: "" };
}
export const ValidateInboxIdsResponse_ValidationResponse = {
encode(message, writer = _m0.Writer.create()) {
if (message.isOk === true) {
writer.uint32(8).bool(message.isOk);
}
if (message.errorMessage !== "") {
writer.uint32(18).string(message.errorMessage);
}
if (message.inboxId !== "") {
writer.uint32(26).string(message.inboxId);
}
return writer;
},
decode(input, length) {
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseValidateInboxIdsResponse_ValidationResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.isOk = reader.bool();
break;
case 2:
message.errorMessage = reader.string();
break;
case 3:
message.inboxId = reader.string();
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object) {
return {
isOk: isSet(object.isOk) ? Boolean(object.isOk) : false,
errorMessage: isSet(object.errorMessage)
? String(object.errorMessage)
: "",
inboxId: isSet(object.inboxId) ? String(object.inboxId) : "",
};
},
toJSON(message) {
const obj = {};
message.isOk !== undefined && (obj.isOk = message.isOk);
message.errorMessage !== undefined &&
(obj.errorMessage = message.errorMessage);
message.inboxId !== undefined && (obj.inboxId = message.inboxId);
return obj;
},
fromPartial(object) {
var _a, _b, _c;
const message = createBaseValidateInboxIdsResponse_ValidationResponse();
message.isOk = (_a = object.isOk) !== null && _a !== void 0 ? _a : false;
message.errorMessage = (_b = object.errorMessage) !== null && _b !== void 0 ? _b : "";
message.inboxId = (_c = object.inboxId) !== null && _c !== void 0 ? _c : "";
return message;
},
};
export class ValidationApiClientImpl {
constructor(rpc) {
this.rpc = rpc;
this.ValidateKeyPackages = this.ValidateKeyPackages.bind(this);
this.ValidateGroupMessages = this.ValidateGroupMessages.bind(this);

@@ -1101,9 +672,3 @@ this.GetAssociationState = this.GetAssociationState.bind(this);

this.ValidateInboxIdKeyPackages.bind(this);
this.ValidateInboxIds = this.ValidateInboxIds.bind(this);
}
ValidateKeyPackages(request) {
const data = ValidateKeyPackagesRequest.encode(request).finish();
const promise = this.rpc.request("xmtp.mls_validation.v1.ValidationApi", "ValidateKeyPackages", data);
return promise.then((data) => ValidateKeyPackagesResponse.decode(new _m0.Reader(data)));
}
ValidateGroupMessages(request) {

@@ -1120,11 +685,6 @@ const data = ValidateGroupMessagesRequest.encode(request).finish();

ValidateInboxIdKeyPackages(request) {
const data = ValidateKeyPackagesRequest.encode(request).finish();
const data = ValidateInboxIdKeyPackagesRequest.encode(request).finish();
const promise = this.rpc.request("xmtp.mls_validation.v1.ValidationApi", "ValidateInboxIdKeyPackages", data);
return promise.then((data) => ValidateInboxIdKeyPackagesResponse.decode(new _m0.Reader(data)));
}
ValidateInboxIds(request) {
const data = ValidateInboxIdsRequest.encode(request).finish();
const promise = this.rpc.request("xmtp.mls_validation.v1.ValidationApi", "ValidateInboxIds", data);
return promise.then((data) => ValidateInboxIdsResponse.decode(new _m0.Reader(data)));
}
}

@@ -1131,0 +691,0 @@ var globalThis = (() => {

@@ -21,5 +21,3 @@ export * as messageApi from "./message_api/v1/message_api.pb";

export * as mlsDatabaseIntent from "./mls/database/intents.pb";
export * as mlsAssociation from "./mls/message_contents/association.pb";
export * as mlsContent from "./mls/message_contents/content.pb";
export * as mlsCredential from "./mls/message_contents/credential.pb";
export * as mlsGroupMembership from "./mls/message_contents/group_membership.pb";

@@ -26,0 +24,0 @@ export * as mlsGroupMetadata from "./mls/message_contents/group_metadata.pb";

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc