@openim/protocol
Version:
OpenIM protocol
60 lines (59 loc) • 1.61 kB
TypeScript
export declare const protobufPackage = "openim.encryption";
export interface CommonResp {
errCode: number;
errMsg: string;
}
export interface MsgContent {
sendID: string;
recvID: string;
groupID: string;
sessionType: number;
msgFrom: number;
contentType: number;
content: Uint8Array;
keyVersion: number;
}
export interface EncryptContentReq {
msgContent: MsgContent | undefined;
recvIDList: string[];
operationID: string;
}
export interface EncryptContentResp {
CommonResp: CommonResp | undefined;
msgContentList: MsgContent[];
}
export interface GetEncryptionKeyReq {
conversationID: string;
keyVersion: number;
}
export interface VersionKey {
version: number;
key: string;
}
export interface GetEncryptionKeyResp {
versionKeyList: VersionKey[];
}
export interface GenEncryptionKeyReq {
conversationID: string;
}
export interface GenEncryptionKeyResp {
}
export interface GroupVersionKey {
version: number;
key: string;
groupID: string;
}
export interface DecryptContentReq {
msgContent: MsgContent | undefined;
operationID: string;
}
export interface DecryptContentResp {
CommonResp: CommonResp | undefined;
msgContent: MsgContent | undefined;
}
export interface encryption {
/** rpc EncryptContent(EncryptContentReq)returns(EncryptContentResp); */
GetEncryptionKey(request: GetEncryptionKeyReq): Promise<GetEncryptionKeyResp>;
/** rpc DecryptContent(DecryptContentReq) returns (DecryptContentResp); */
GenEncryptionKey(request: GenEncryptionKeyReq): Promise<GenEncryptionKeyResp>;
}