Migrate project to pnpm monorepo

Restructure the repository into a pnpm workspace under packages/ (core, webui, runtime). Move source files for core and webui into packages/*, add package manifests for @snowluma/core and @snowluma/runtime, and remove the old launcher package.json. Update root package.json to be a monorepo controller (scripts delegate to pnpm filters, set packageManager and Node engine). Configure build outputs to emit into the repo-root dist/ (vite config changes) so the existing release pipeline continues to work. Add .npmrc with mirrors, expand .gitignore for monorepo layout, add tsconfig base and package-level tsconfigs, and add vitest config for the core package. Adjust injector native search paths and update tests import paths to the new package layout. Small CI/workflow comment added to clarify build behavior and README updated with monorepo structure and common commands.
This commit is contained in:
手瓜一十雪 committed 2026-05-03 14:02:29 +08:00
1 parent 6bba36bba6
commit 39f1672b29
122 files changed
+279 -85

No files matched your search

+89
View File
@@ -0,0 +1,89 @@
// Proto schemas for outgoing message actions.
// Port of src/bridge/include/bridge/proto/action.h
import type { ProtoSchema } from '../../protobuf/decode';
import { ElemSchema } from './element';
// --- Routing ---
export const RoutingC2CSchema = {
uin: { field: 1, type: 'uint32' as const },
uid: { field: 2, type: 'string' as const },
} satisfies ProtoSchema;
export const RoutingGroupSchema = {
groupCode: { field: 1, type: 'uint64' as const },
} satisfies ProtoSchema;
export const RoutingHeadSchema = {
c2c: { field: 1, type: 'message' as const, schema: RoutingC2CSchema },
grp: { field: 2, type: 'message' as const, schema: RoutingGroupSchema },
} satisfies ProtoSchema;
// --- Content Head (for send) ---
export const SendContentHeadSchema = {
type: { field: 1, type: 'uint32' as const },
subType: { field: 2, type: 'uint32' as const },
c2cCmd: { field: 3, type: 'uint32' as const },
} satisfies ProtoSchema;
// --- Message Control ---
export const MessageControlSchema = {
msgFlag: { field: 1, type: 'int32' as const },
} satisfies ProtoSchema;
// --- RichText (for send — only elems) ---
export const SendRichTextSchema = {
elems: { field: 2, type: 'repeated_message' as const, schema: ElemSchema },
} satisfies ProtoSchema;
// --- MessageBody (for send) ---
export const SendMessageBodySchema = {
richText: { field: 1, type: 'message' as const, schema: SendRichTextSchema },
} satisfies ProtoSchema;
// --- SendMessageRequest ---
export const SendMessageRequestSchema = {
routingHead: { field: 1, type: 'message' as const, schema: RoutingHeadSchema },
contentHead: { field: 2, type: 'message' as const, schema: SendContentHeadSchema },
messageBody: { field: 3, type: 'message' as const, schema: SendMessageBodySchema },
clientSequence: { field: 4, type: 'uint32' as const },
random: { field: 5, type: 'uint32' as const },
syncCookie: { field: 6, type: 'bytes' as const },
via: { field: 8, type: 'uint32' as const },
dataStatist: { field: 9, type: 'uint32' as const },
ctrl: { field: 12, type: 'message' as const, schema: MessageControlSchema },
multiSendSeq: { field: 14, type: 'uint32' as const },
} satisfies ProtoSchema;
// --- SendMessageResponse ---
export const SendMessageResponseSchema = {
result: { field: 1, type: 'int32' as const },
errMsg: { field: 2, type: 'string' as const },
timestamp1: { field: 3, type: 'uint32' as const },
field10: { field: 10, type: 'uint32' as const },
groupSequence: { field: 11, type: 'uint32' as const },
timestamp2: { field: 12, type: 'uint32' as const },
privateSequence: { field: 14, type: 'uint32' as const },
} satisfies ProtoSchema;
// --- MentionExtra (for building @mention text element) ---
export const MentionExtraSendSchema = {
type: { field: 3, type: 'int32' as const },
uin: { field: 4, type: 'uint32' as const },
field5: { field: 5, type: 'int32' as const },
uid: { field: 9, type: 'string' as const },
} satisfies ProtoSchema;
// --- MarkdownData ---
export const MarkdownDataSchema = {
content: { field: 1, type: 'string' as const },
} satisfies ProtoSchema;
+418
View File
@@ -0,0 +1,418 @@
// Proto schemas for QQ message elements.
// Port of src/bridge/include/bridge/proto/element.h
import type { ProtoSchema } from '../../protobuf/decode';
// --- Nested / helper schemas ---
export const CustomFacePbReserveSchema = {
subType: { field: 1, type: 'int32' as const },
summary: { field: 9, type: 'string' as const },
} satisfies ProtoSchema;
export const NotOnlineImagePbReserve2Schema = {
field1: { field: 1, type: 'int32' as const },
field2: { field: 2, type: 'string' as const },
field3: { field: 3, type: 'int32' as const },
field4: { field: 4, type: 'int32' as const },
field5: { field: 5, type: 'int32' as const },
field7: { field: 7, type: 'string' as const },
} satisfies ProtoSchema;
export const NotOnlineImagePbReserveSchema = {
subType: { field: 1, type: 'int32' as const },
field3: { field: 3, type: 'int32' as const },
field4: { field: 4, type: 'int32' as const },
summary: { field: 8, type: 'string' as const },
field10: { field: 10, type: 'int32' as const },
field20: { field: 20, type: 'message' as const, schema: NotOnlineImagePbReserve2Schema },
url: { field: 30, type: 'string' as const },
md5Str: { field: 31, type: 'string' as const },
} satisfies ProtoSchema;
// --- Core element schemas ---
export const TextElemSchema = {
str: { field: 1, type: 'string' as const },
link: { field: 2, type: 'string' as const },
attr6Buf: { field: 3, type: 'bytes' as const },
attr7Buf: { field: 4, type: 'bytes' as const },
buf: { field: 11, type: 'bytes' as const },
pbReserve: { field: 12, type: 'bytes' as const },
} satisfies ProtoSchema;
export const FaceElemSchema = {
index: { field: 1, type: 'int32' as const },
oldData: { field: 2, type: 'bytes' as const },
buf: { field: 11, type: 'bytes' as const },
} satisfies ProtoSchema;
export const OnlineImageSchema = {
guid: { field: 1, type: 'bytes' as const },
filePath: { field: 2, type: 'bytes' as const },
oldVerSendFile: { field: 3, type: 'bytes' as const },
} satisfies ProtoSchema;
export const NotOnlineImageSchema = {
filePath: { field: 1, type: 'string' as const },
fileLen: { field: 2, type: 'uint32' as const },
downloadPath: { field: 3, type: 'string' as const },
oldVerSendFile: { field: 4, type: 'bytes' as const },
imgType: { field: 5, type: 'int32' as const },
previewsImage: { field: 6, type: 'bytes' as const },
picMd5: { field: 7, type: 'bytes' as const },
picHeight: { field: 8, type: 'uint32' as const },
picWidth: { field: 9, type: 'uint32' as const },
resId: { field: 10, type: 'string' as const },
flag: { field: 11, type: 'bytes' as const },
thumbUrl: { field: 12, type: 'string' as const },
original: { field: 13, type: 'int32' as const },
bigUrl: { field: 14, type: 'string' as const },
origUrl: { field: 15, type: 'string' as const },
bizType: { field: 16, type: 'int32' as const },
result: { field: 17, type: 'int32' as const },
index: { field: 18, type: 'int32' as const },
opFaceBuf: { field: 19, type: 'bytes' as const },
oldPicMd5: { field: 20, type: 'bool' as const },
thumbWidth: { field: 21, type: 'int32' as const },
thumbHeight: { field: 22, type: 'int32' as const },
fileId: { field: 23, type: 'int32' as const },
showLen: { field: 24, type: 'uint32' as const },
downloadLen: { field: 25, type: 'uint32' as const },
x400Url: { field: 26, type: 'string' as const },
x400Width: { field: 27, type: 'int32' as const },
x400Height: { field: 28, type: 'int32' as const },
pbRes: { field: 29, type: 'message' as const, schema: NotOnlineImagePbReserveSchema },
} satisfies ProtoSchema;
export const TransElemSchema = {
elemType: { field: 1, type: 'int32' as const },
elemValue: { field: 2, type: 'bytes' as const },
} satisfies ProtoSchema;
export const MarketFaceSchema = {
faceName: { field: 1, type: 'string' as const },
itemType: { field: 2, type: 'uint32' as const },
faceInfo: { field: 3, type: 'uint32' as const },
faceId: { field: 4, type: 'bytes' as const },
tabId: { field: 5, type: 'uint32' as const },
subType: { field: 6, type: 'uint32' as const },
key: { field: 7, type: 'bytes' as const },
param: { field: 8, type: 'bytes' as const },
mediaType: { field: 9, type: 'uint32' as const },
imageWidth: { field: 10, type: 'uint32' as const },
imageHeight: { field: 11, type: 'uint32' as const },
mobileParam: { field: 12, type: 'bytes' as const },
pbReserve: { field: 13, type: 'bytes' as const },
} satisfies ProtoSchema;
export const CustomFaceSchema = {
guid: { field: 1, type: 'bytes' as const },
filePath: { field: 2, type: 'string' as const },
shortcut: { field: 3, type: 'string' as const },
buffer: { field: 4, type: 'bytes' as const },
flag: { field: 5, type: 'bytes' as const },
oldData: { field: 6, type: 'bytes' as const },
fileId: { field: 7, type: 'uint32' as const },
serverIp: { field: 8, type: 'int32' as const },
serverPort: { field: 9, type: 'int32' as const },
fileType: { field: 10, type: 'int32' as const },
signature: { field: 11, type: 'bytes' as const },
useful: { field: 12, type: 'int32' as const },
md5: { field: 13, type: 'bytes' as const },
thumbUrl: { field: 14, type: 'string' as const },
bigUrl: { field: 15, type: 'string' as const },
origUrl: { field: 16, type: 'string' as const },
bizType: { field: 17, type: 'int32' as const },
repeatIndex: { field: 18, type: 'int32' as const },
repeatImage: { field: 19, type: 'int32' as const },
imageType: { field: 20, type: 'int32' as const },
index: { field: 21, type: 'int32' as const },
width: { field: 22, type: 'int32' as const },
height: { field: 23, type: 'int32' as const },
source: { field: 24, type: 'int32' as const },
size: { field: 25, type: 'uint32' as const },
origin: { field: 26, type: 'int32' as const },
thumbWidth: { field: 27, type: 'int32' as const },
thumbHeight: { field: 28, type: 'int32' as const },
showLen: { field: 29, type: 'int32' as const },
downloadLen: { field: 30, type: 'int32' as const },
x400Url: { field: 31, type: 'string' as const },
x400Width: { field: 32, type: 'int32' as const },
x400Height: { field: 33, type: 'int32' as const },
pbRes: { field: 34, type: 'message' as const, schema: CustomFacePbReserveSchema },
} satisfies ProtoSchema;
export const RichMsgSchema = {
template1: { field: 1, type: 'bytes' as const },
serviceId: { field: 2, type: 'int32' as const },
msgResId: { field: 3, type: 'bytes' as const },
rand: { field: 4, type: 'int32' as const },
seq: { field: 5, type: 'uint32' as const },
} satisfies ProtoSchema;
export const GroupFileElemSchema = {
filename: { field: 1, type: 'string' as const },
fileSize: { field: 2, type: 'uint64' as const },
fileId: { field: 3, type: 'string' as const },
batchId: { field: 4, type: 'string' as const },
fileKey: { field: 5, type: 'string' as const },
mark: { field: 6, type: 'bytes' as const },
sequence: { field: 7, type: 'uint64' as const },
batchItemId: { field: 8, type: 'bytes' as const },
feedMsgTime: { field: 9, type: 'int32' as const },
pbReserve: { field: 10, type: 'bytes' as const },
} satisfies ProtoSchema;
export const ExtraInfoSchema = {
nick: { field: 1, type: 'bytes' as const },
groupCard: { field: 2, type: 'bytes' as const },
level: { field: 3, type: 'int32' as const },
flags: { field: 4, type: 'int32' as const },
groupMask: { field: 5, type: 'int32' as const },
msgTailId: { field: 6, type: 'int32' as const },
senderTitle: { field: 7, type: 'bytes' as const },
apnsTips: { field: 8, type: 'bytes' as const },
uin: { field: 9, type: 'uint64' as const },
msgStateFlag: { field: 10, type: 'int32' as const },
apnsSoundType: { field: 11, type: 'int32' as const },
newGroupFlag: { field: 12, type: 'int32' as const },
} satisfies ProtoSchema;
export const VideoFileSchema = {
fileUuid: { field: 1, type: 'string' as const },
fileMd5: { field: 2, type: 'bytes' as const },
fileName: { field: 3, type: 'string' as const },
fileFormat: { field: 4, type: 'int32' as const },
fileTime: { field: 5, type: 'int32' as const },
fileSize: { field: 6, type: 'int32' as const },
thumbWidth: { field: 7, type: 'int32' as const },
thumbHeight: { field: 8, type: 'int32' as const },
thumbFileMd5: { field: 9, type: 'bytes' as const },
source: { field: 10, type: 'bytes' as const },
thumbFileSize:{ field: 11, type: 'int32' as const },
busiType: { field: 12, type: 'int32' as const },
fromChatType: { field: 13, type: 'int32' as const },
toChatType: { field: 14, type: 'int32' as const },
supportProgressive: { field: 15, type: 'bool' as const },
fileWidth: { field: 16, type: 'int32' as const },
fileHeight: { field: 17, type: 'int32' as const },
subBusiType: { field: 18, type: 'int32' as const },
videoAttr: { field: 19, type: 'int32' as const },
pbReserve: { field: 24, type: 'bytes' as const },
} satisfies ProtoSchema;
export const SrcMsgSchema = {
origSeqs: { field: 1, type: 'repeated_uint32' as const },
senderUin: { field: 2, type: 'uint64' as const },
time: { field: 3, type: 'int32' as const },
flag: { field: 4, type: 'int32' as const },
elemsRaw: { field: 5, type: 'repeated_bytes' as const },
type: { field: 6, type: 'int32' as const },
richMsg: { field: 7, type: 'bytes' as const },
pbReserve: { field: 8, type: 'bytes' as const },
sourceMsg: { field: 9, type: 'bytes' as const },
toUin: { field: 10, type: 'uint64' as const },
troopName: { field: 11, type: 'bytes' as const },
} satisfies ProtoSchema;
export const LightAppElemSchema = {
data: { field: 1, type: 'bytes' as const },
msgResid: { field: 2, type: 'bytes' as const },
} satisfies ProtoSchema;
export const CommonElemSchema = {
serviceType: { field: 1, type: 'int32' as const },
pbElem: { field: 2, type: 'bytes' as const },
businessType: { field: 3, type: 'uint32' as const },
} satisfies ProtoSchema;
export const GeneralFlagsSchema = {
bubbleDiyTextId: { field: 1, type: 'int32' as const },
groupFlagNew: { field: 2, type: 'int32' as const },
uin: { field: 3, type: 'uint64' as const },
longTextFlag: { field: 6, type: 'int32' as const },
longTextResId: { field: 7, type: 'string' as const },
} satisfies ProtoSchema;
// --- Elem (union of all element types) ---
export const ElemSchema = {
text: { field: 1, type: 'message' as const, schema: TextElemSchema },
face: { field: 2, type: 'message' as const, schema: FaceElemSchema },
onlineImage: { field: 3, type: 'message' as const, schema: OnlineImageSchema },
notOnlineImage: { field: 4, type: 'message' as const, schema: NotOnlineImageSchema },
transElem: { field: 5, type: 'message' as const, schema: TransElemSchema },
marketFace: { field: 6, type: 'message' as const, schema: MarketFaceSchema },
customFace: { field: 8, type: 'message' as const, schema: CustomFaceSchema },
richMsg: { field: 12, type: 'message' as const, schema: RichMsgSchema },
groupFile: { field: 13, type: 'message' as const, schema: GroupFileElemSchema },
extraInfo: { field: 16, type: 'message' as const, schema: ExtraInfoSchema },
videoFile: { field: 19, type: 'message' as const, schema: VideoFileSchema },
generalFlags: { field: 37, type: 'message' as const, schema: GeneralFlagsSchema },
srcMsg: { field: 45, type: 'message' as const, schema: SrcMsgSchema },
lightApp: { field: 51, type: 'message' as const, schema: LightAppElemSchema },
commonElem: { field: 53, type: 'message' as const, schema: CommonElemSchema },
} satisfies ProtoSchema;
// --- Extra decode types (for CommonElem.pbElem sub-messages) ---
export const MentionExtraSchema = {
type: { field: 3, type: 'int32' as const },
uin: { field: 4, type: 'uint32' as const },
field5: { field: 5, type: 'int32' as const },
uid: { field: 9, type: 'string' as const },
} satisfies ProtoSchema;
export const QFaceExtraSchema = {
packId: { field: 1, type: 'string' as const },
stickerId: { field: 2, type: 'string' as const },
qsid: { field: 3, type: 'int32' as const },
sourceType: { field: 4, type: 'int32' as const },
stickerType: { field: 5, type: 'int32' as const },
resultId: { field: 6, type: 'string' as const },
text: { field: 7, type: 'string' as const },
randomType: { field: 9, type: 'int32' as const },
} satisfies ProtoSchema;
export const QSmallFaceExtraSchema = {
faceId: { field: 1, type: 'uint32' as const },
preview: { field: 2, type: 'string' as const },
preview2: { field: 3, type: 'string' as const },
} satisfies ProtoSchema;
// --- NTQQ MsgInfo types (CommonElem service_type 48) ---
export const FileTypeSchema = {
type: { field: 1, type: 'uint32' as const },
picFormat: { field: 2, type: 'uint32' as const },
videoFormat: { field: 3, type: 'uint32' as const },
voiceFormat: { field: 4, type: 'uint32' as const },
} satisfies ProtoSchema;
export const FileInfoSchema = {
fileSize: { field: 1, type: 'uint32' as const },
fileHash: { field: 2, type: 'string' as const },
fileSha1: { field: 3, type: 'string' as const },
fileName: { field: 4, type: 'string' as const },
type: { field: 5, type: 'message' as const, schema: FileTypeSchema },
width: { field: 6, type: 'uint32' as const },
height: { field: 7, type: 'uint32' as const },
time: { field: 8, type: 'uint32' as const },
original: { field: 9, type: 'uint32' as const },
} satisfies ProtoSchema;
export const IndexNodeSchema = {
info: { field: 1, type: 'message' as const, schema: FileInfoSchema },
fileUuid: { field: 2, type: 'string' as const },
storeId: { field: 3, type: 'uint32' as const },
uploadTime: { field: 4, type: 'uint32' as const },
ttl: { field: 5, type: 'uint32' as const },
subType: { field: 6, type: 'uint32' as const },
} satisfies ProtoSchema;
export const PicUrlExtInfoSchema = {
originalParameter: { field: 1, type: 'string' as const },
bigParameter: { field: 2, type: 'string' as const },
thumbParameter: { field: 3, type: 'string' as const },
} satisfies ProtoSchema;
export const PictureInfoSchema = {
urlPath: { field: 1, type: 'string' as const },
ext: { field: 2, type: 'message' as const, schema: PicUrlExtInfoSchema },
domain: { field: 3, type: 'string' as const },
} satisfies ProtoSchema;
export const PicExtDataSchema = {
subType: { field: 1, type: 'uint32' as const },
textSummary: { field: 9, type: 'string' as const },
} satisfies ProtoSchema;
export const PicExtBizInfoSchema = {
bizType: { field: 1, type: 'uint32' as const },
textSummary: { field: 2, type: 'string' as const },
bytesPbReserveC2c: { field: 11, type: 'bytes' as const },
extData: { field: 12, type: 'message' as const, schema: PicExtDataSchema },
fromScene: { field: 1001, type: 'uint32' as const },
toScene: { field: 1002, type: 'uint32' as const },
oldFileId: { field: 1003, type: 'uint32' as const },
} satisfies ProtoSchema;
export const VideoExtBizInfoSchema = {
fromScene: { field: 1, type: 'uint32' as const },
toScene: { field: 2, type: 'uint32' as const },
bytesPbReserve: { field: 3, type: 'bytes' as const },
} satisfies ProtoSchema;
export const PttExtBizInfoSchema = {
srcUin: { field: 1, type: 'uint64' as const },
pttScene: { field: 2, type: 'uint32' as const },
pttType: { field: 3, type: 'uint32' as const },
changeVoice: { field: 4, type: 'uint32' as const },
waveform: { field: 5, type: 'bytes' as const },
autoConvertText: { field: 6, type: 'uint32' as const },
bytesReserve: { field: 11, type: 'bytes' as const },
bytesPbReserve: { field: 12, type: 'bytes' as const },
bytesGeneralFlags: { field: 13, type: 'bytes' as const },
} satisfies ProtoSchema;
export const ExtBizInfoSchema = {
pic: { field: 1, type: 'message' as const, schema: PicExtBizInfoSchema },
video: { field: 2, type: 'message' as const, schema: VideoExtBizInfoSchema },
ptt: { field: 3, type: 'message' as const, schema: PttExtBizInfoSchema },
busiType: { field: 10, type: 'uint32' as const },
} satisfies ProtoSchema;
export const C2cSourceSchema = {
friendUid: { field: 2, type: 'string' as const },
} satisfies ProtoSchema;
export const TroopSourceSchema = {
groupUin: { field: 1, type: 'uint32' as const },
} satisfies ProtoSchema;
export const HashSumSchema = {
bytesPbReserveC2c: { field: 201, type: 'message' as const, schema: C2cSourceSchema },
troopSource: { field: 202, type: 'message' as const, schema: TroopSourceSchema },
} satisfies ProtoSchema;
export const MsgInfoBodySchema = {
index: { field: 1, type: 'message' as const, schema: IndexNodeSchema },
picture: { field: 2, type: 'message' as const, schema: PictureInfoSchema },
fileExist: { field: 5, type: 'bool' as const },
hashSum: { field: 6, type: 'message' as const, schema: HashSumSchema },
} satisfies ProtoSchema;
export const MsgInfoSchema = {
msgInfoBody: { field: 1, type: 'repeated_message' as const, schema: MsgInfoBodySchema },
extBizInfo: { field: 2, type: 'message' as const, schema: ExtBizInfoSchema },
} satisfies ProtoSchema;
// --- GroupFileExtra (TransElem type=24) ---
export const GroupFileInfoSchema = {
busId: { field: 1, type: 'uint32' as const },
fileId: { field: 2, type: 'string' as const },
fileSize: { field: 3, type: 'uint64' as const },
fileName: { field: 4, type: 'string' as const },
fileSha: { field: 5, type: 'bytes' as const },
extInfoString: { field: 6, type: 'string' as const },
fileMd5: { field: 7, type: 'bytes' as const },
} satisfies ProtoSchema;
export const GroupFileExtraInnerSchema = {
info: { field: 2, type: 'message' as const, schema: GroupFileInfoSchema },
} satisfies ProtoSchema;
export const GroupFileExtraSchema = {
inner: { field: 7, type: 'message' as const, schema: GroupFileExtraInnerSchema },
} satisfies ProtoSchema;
// --- Preserve (for message receipt info) ---
export const PreserveSchema = {
messageId: { field: 3, type: 'uint64' as const },
senderUid: { field: 6, type: 'string' as const },
receiverUid: { field: 7, type: 'string' as const },
clientSequence: { field: 8, type: 'uint32' as const },
} satisfies ProtoSchema;
+354
View File
@@ -0,0 +1,354 @@
// Proto schemas for highway upload protocol.
// Port of src/bridge/include/bridge/proto/highway.h + action.h (HttpConn)
import type { ProtoSchema } from '../../protobuf/decode';
import {
IndexNodeSchema,
PictureInfoSchema,
HashSumSchema,
PicExtBizInfoSchema,
VideoExtBizInfoSchema,
PttExtBizInfoSchema,
} from '../proto/element';
// --- DataHighwayHead ---
export const DataHighwayHeadSchema = {
version: { field: 1, type: 'uint32' as const },
uin: { field: 2, type: 'string' as const },
command: { field: 3, type: 'string' as const },
seq: { field: 4, type: 'uint32' as const },
retryTimes:{ field: 5, type: 'uint32' as const },
appId: { field: 6, type: 'uint32' as const },
dataFlag: { field: 7, type: 'uint32' as const },
commandId: { field: 8, type: 'uint32' as const },
} satisfies ProtoSchema;
export const SegHeadSchema = {
serviceId: { field: 1, type: 'uint32' as const },
filesize: { field: 2, type: 'uint64' as const },
dataOffset: { field: 3, type: 'uint64' as const },
dataLength: { field: 4, type: 'uint32' as const },
retCode: { field: 5, type: 'uint32' as const },
serviceTicket: { field: 6, type: 'bytes' as const },
flag: { field: 7, type: 'uint32' as const },
md5: { field: 8, type: 'bytes' as const },
fileMd5: { field: 9, type: 'bytes' as const },
cacheAddr: { field: 10, type: 'uint32' as const },
cachePort: { field: 13, type: 'uint32' as const },
} satisfies ProtoSchema;
export const LoginSigHeadSchema = {
loginSigType: { field: 1, type: 'uint32' as const },
appId: { field: 3, type: 'uint32' as const },
} satisfies ProtoSchema;
export const ReqDataHighwayHeadSchema = {
msgBaseHead: { field: 1, type: 'message' as const, schema: DataHighwayHeadSchema },
msgSegHead: { field: 2, type: 'message' as const, schema: SegHeadSchema },
bytesReqExtendInfo: { field: 3, type: 'bytes' as const },
timestamp: { field: 4, type: 'uint64' as const },
msgLoginSigHead: { field: 5, type: 'message' as const, schema: LoginSigHeadSchema },
} satisfies ProtoSchema;
export const RespDataHighwayHeadSchema = {
msgBaseHead: { field: 1, type: 'message' as const, schema: DataHighwayHeadSchema },
msgSegHead: { field: 2, type: 'message' as const, schema: SegHeadSchema },
errorCode: { field: 3, type: 'uint32' as const },
} satisfies ProtoSchema;
// --- Highway extend (NTV2RichMediaHighwayExt) ---
export const HighwayDomainSchema = {
isEnable: { field: 1, type: 'bool' as const },
ip: { field: 2, type: 'string' as const },
} satisfies ProtoSchema;
export const HighwayIPv4Schema = {
domain: { field: 1, type: 'message' as const, schema: HighwayDomainSchema },
port: { field: 2, type: 'uint32' as const },
} satisfies ProtoSchema;
export const HighwayNetworkSchema = {
ipv4s: { field: 1, type: 'repeated_message' as const, schema: HighwayIPv4Schema },
} satisfies ProtoSchema;
export const HighwayHashSchema = {
fileSha1: { field: 1, type: 'repeated_bytes' as const },
} satisfies ProtoSchema;
export const HighwayMsgInfoBodySchema = {
index: { field: 1, type: 'message' as const, schema: IndexNodeSchema },
picture: { field: 2, type: 'message' as const, schema: PictureInfoSchema },
fileExist: { field: 5, type: 'bool' as const },
hashSum: { field: 6, type: 'message' as const, schema: HashSumSchema },
} satisfies ProtoSchema;
export const NTV2RichMediaHighwayExtSchema = {
fileUuid: { field: 1, type: 'string' as const },
uKey: { field: 2, type: 'string' as const },
network: { field: 5, type: 'message' as const, schema: HighwayNetworkSchema },
msgInfoBody: { field: 6, type: 'repeated_message' as const, schema: HighwayMsgInfoBodySchema },
blockSize: { field: 10, type: 'uint32' as const },
hash: { field: 11, type: 'message' as const, schema: HighwayHashSchema },
} satisfies ProtoSchema;
// --- File upload extend (group/private file highway) ---
export const FileUploadUrlSchema = {
unknown: { field: 1, type: 'int32' as const },
host: { field: 2, type: 'string' as const },
} satisfies ProtoSchema;
export const FileUploadHostSchema = {
url: { field: 1, type: 'message' as const, schema: FileUploadUrlSchema },
port: { field: 2, type: 'uint32' as const },
} satisfies ProtoSchema;
export const FileUploadHostConfigSchema = {
hosts: { field: 200, type: 'repeated_message' as const, schema: FileUploadHostSchema },
} satisfies ProtoSchema;
export const FileUploadNameInfoSchema = {
fileName: { field: 100, type: 'string' as const },
} satisfies ProtoSchema;
export const FileUploadClientInfoSchema = {
clientType: { field: 100, type: 'int32' as const },
appId: { field: 200, type: 'string' as const },
terminalType: { field: 300, type: 'int32' as const },
clientVer: { field: 400, type: 'string' as const },
unknown: { field: 600, type: 'int32' as const },
} satisfies ProtoSchema;
export const FileUploadFileEntrySchema = {
fileSize: { field: 100, type: 'uint64' as const },
md5: { field: 200, type: 'bytes' as const },
checkKey: { field: 300, type: 'bytes' as const },
md5S2: { field: 400, type: 'bytes' as const },
fileId: { field: 600, type: 'string' as const },
uploadKey: { field: 700, type: 'bytes' as const },
} satisfies ProtoSchema;
export const FileUploadBusiInfoSchema = {
busId: { field: 1, type: 'int32' as const },
senderUin: { field: 100, type: 'uint64' as const },
receiverUin: { field: 200, type: 'uint64' as const },
groupCode: { field: 400, type: 'uint64' as const },
} satisfies ProtoSchema;
export const FileUploadEntrySchema = {
busiBuff: { field: 100, type: 'message' as const, schema: FileUploadBusiInfoSchema },
fileEntry: { field: 200, type: 'message' as const, schema: FileUploadFileEntrySchema },
clientInfo: { field: 300, type: 'message' as const, schema: FileUploadClientInfoSchema },
fileNameInfo: { field: 400, type: 'message' as const, schema: FileUploadNameInfoSchema },
host: { field: 500, type: 'message' as const, schema: FileUploadHostConfigSchema },
} satisfies ProtoSchema;
export const FileUploadExtSchema = {
unknown1: { field: 1, type: 'int32' as const },
unknown2: { field: 2, type: 'int32' as const },
unknown3: { field: 3, type: 'int32' as const },
entry: { field: 100, type: 'message' as const, schema: FileUploadEntrySchema },
unknown200: { field: 200, type: 'int32' as const },
} satisfies ProtoSchema;
// --- Encodable MsgInfo (for embedding in message element) ---
export const EncodableMediaExtBizInfoSchema = {
pic: { field: 1, type: 'message' as const, schema: PicExtBizInfoSchema },
video: { field: 2, type: 'message' as const, schema: VideoExtBizInfoSchema },
ptt: { field: 3, type: 'message' as const, schema: PttExtBizInfoSchema },
busiType: { field: 10, type: 'uint32' as const },
} satisfies ProtoSchema;
export const EncodableMediaMsgInfoSchema = {
msgInfoBody: { field: 1, type: 'repeated_message' as const, schema: HighwayMsgInfoBodySchema },
extBizInfo: { field: 2, type: 'message' as const, schema: EncodableMediaExtBizInfoSchema },
} satisfies ProtoSchema;
// --- HttpConn.0x6ff_501 (highway session) ---
export const HttpConnSchema = {
field1: { field: 1, type: 'int32' as const },
field2: { field: 2, type: 'int32' as const },
field3: { field: 3, type: 'int32' as const },
field4: { field: 4, type: 'int32' as const },
field6: { field: 6, type: 'int32' as const },
serviceTypes: { field: 7, type: 'repeated_uint32' as const },
field9: { field: 9, type: 'int32' as const },
field10: { field: 10, type: 'int32' as const },
field11: { field: 11, type: 'int32' as const },
ver: { field: 15, type: 'string' as const },
} satisfies ProtoSchema;
export const HttpConn0x6FF501RequestSchema = {
httpConn: { field: 0x501, type: 'message' as const, schema: HttpConnSchema },
} satisfies ProtoSchema;
export const ServerAddrSchema = {
type: { field: 1, type: 'uint32' as const },
ip: { field: 2, type: 'uint32' as const }, // fixed32 as uint32
port: { field: 3, type: 'uint32' as const },
area: { field: 4, type: 'uint32' as const },
} satisfies ProtoSchema;
export const ServerInfoSchema = {
serviceType: { field: 1, type: 'uint32' as const },
serverAddrs: { field: 2, type: 'repeated_message' as const, schema: ServerAddrSchema },
} satisfies ProtoSchema;
export const HttpConnResponseSchema = {
sigSession: { field: 1, type: 'bytes' as const },
sessionKey: { field: 2, type: 'bytes' as const },
serverInfos: { field: 3, type: 'repeated_message' as const, schema: ServerInfoSchema },
} satisfies ProtoSchema;
export const HttpConn0x6FF501ResponseSchema = {
httpConn: { field: 0x501, type: 'message' as const, schema: HttpConnResponseSchema },
} satisfies ProtoSchema;
// --- NTV2 Upload Request (for OIDB 0x11C4/0x11C5) ---
export const NTV2FileTypeSchema = {
type: { field: 1, type: 'uint32' as const },
picFormat: { field: 2, type: 'uint32' as const },
videoFormat: { field: 3, type: 'uint32' as const },
voiceFormat: { field: 4, type: 'uint32' as const },
} satisfies ProtoSchema;
export const NTV2FileInfoSchema = {
fileSize: { field: 1, type: 'uint32' as const },
fileHash: { field: 2, type: 'string' as const },
fileSha1: { field: 3, type: 'string' as const },
fileName: { field: 4, type: 'string' as const },
type: { field: 5, type: 'message' as const, schema: NTV2FileTypeSchema },
width: { field: 6, type: 'uint32' as const },
height: { field: 7, type: 'uint32' as const },
time: { field: 8, type: 'uint32' as const },
original: { field: 9, type: 'uint32' as const },
} satisfies ProtoSchema;
export const NTV2UploadInfoSchema = {
fileInfo: { field: 1, type: 'message' as const, schema: NTV2FileInfoSchema },
subFileType: { field: 2, type: 'uint32' as const },
} satisfies ProtoSchema;
export const NTV2PicReserveC2CSchema = {
subType: { field: 1, type: 'uint32' as const },
} satisfies ProtoSchema;
export const NTV2PicReserveTroopSchema = {
subType: { field: 1, type: 'uint32' as const },
} satisfies ProtoSchema;
export const NTV2PicExtBizInfoSchema = {
bizType: { field: 1, type: 'uint32' as const },
textSummary: { field: 2, type: 'string' as const },
reserveC2c: { field: 11, type: 'message' as const, schema: NTV2PicReserveC2CSchema },
reserveTroop: { field: 12, type: 'message' as const, schema: NTV2PicReserveTroopSchema },
} satisfies ProtoSchema;
export const NTV2VideoExtBizInfoSchema = {
bytesPbReserve: { field: 3, type: 'bytes' as const },
} satisfies ProtoSchema;
export const NTV2PttExtBizInfoSchema = {
bytesReserve: { field: 11, type: 'bytes' as const },
bytesPbReserve: { field: 12, type: 'bytes' as const },
bytesGeneralFlags: { field: 13, type: 'bytes' as const },
} satisfies ProtoSchema;
export const NTV2ExtBizInfoSchema = {
pic: { field: 1, type: 'message' as const, schema: NTV2PicExtBizInfoSchema },
video: { field: 2, type: 'message' as const, schema: NTV2VideoExtBizInfoSchema },
ptt: { field: 3, type: 'message' as const, schema: NTV2PttExtBizInfoSchema },
busiType: { field: 10, type: 'uint32' as const },
} satisfies ProtoSchema;
export const NTV2UploadReqSchema = {
uploadInfo: { field: 1, type: 'repeated_message' as const, schema: NTV2UploadInfoSchema },
tryFastUploadCompleted: { field: 2, type: 'bool' as const },
srvSendMsg: { field: 3, type: 'bool' as const },
clientRandomId: { field: 4, type: 'uint64' as const },
compatQmsgSceneType: { field: 5, type: 'uint32' as const },
extBizInfo: { field: 6, type: 'message' as const, schema: NTV2ExtBizInfoSchema },
clientSeq: { field: 7, type: 'uint32' as const },
noNeedCompatMsg: { field: 8, type: 'bool' as const },
} satisfies ProtoSchema;
export const NTV2C2CUserInfoSchema = {
accountType: { field: 1, type: 'uint32' as const },
targetUid: { field: 2, type: 'string' as const },
} satisfies ProtoSchema;
export const NTV2GroupInfoSchema = {
groupUin: { field: 1, type: 'uint32' as const },
} satisfies ProtoSchema;
export const NTV2UploadSceneInfoSchema = {
requestType: { field: 101, type: 'uint32' as const },
businessType: { field: 102, type: 'uint32' as const },
sceneType: { field: 200, type: 'uint32' as const },
c2c: { field: 201, type: 'message' as const, schema: NTV2C2CUserInfoSchema },
group: { field: 202, type: 'message' as const, schema: NTV2GroupInfoSchema },
} satisfies ProtoSchema;
export const NTV2CommonHeadSchema = {
requestId: { field: 1, type: 'uint32' as const },
command: { field: 2, type: 'uint32' as const },
} satisfies ProtoSchema;
export const NTV2ClientMetaSchema = {
agentType: { field: 1, type: 'uint32' as const },
} satisfies ProtoSchema;
export const NTV2UploadReqHeadSchema = {
common: { field: 1, type: 'message' as const, schema: NTV2CommonHeadSchema },
scene: { field: 2, type: 'message' as const, schema: NTV2UploadSceneInfoSchema },
client: { field: 3, type: 'message' as const, schema: NTV2ClientMetaSchema },
} satisfies ProtoSchema;
export const NTV2UploadRichMediaReqSchema = {
reqHead: { field: 1, type: 'message' as const, schema: NTV2UploadReqHeadSchema },
upload: { field: 2, type: 'message' as const, schema: NTV2UploadReqSchema },
} satisfies ProtoSchema;
// --- NTV2 Upload Response ---
export const NTV2IPv4Schema = {
outIp: { field: 1, type: 'uint32' as const },
outPort: { field: 2, type: 'uint32' as const },
} satisfies ProtoSchema;
export const NTV2SubFileInfoRespSchema = {
subType: { field: 1, type: 'uint32' as const },
uKey: { field: 2, type: 'string' as const },
uKeyTtl: { field: 3, type: 'uint32' as const },
ipv4s: { field: 4, type: 'repeated_message' as const, schema: NTV2IPv4Schema },
} satisfies ProtoSchema;
export const NTV2UploadRespMsgInfoSchema = {
msgInfoBody: { field: 1, type: 'repeated_message' as const, schema: HighwayMsgInfoBodySchema },
extBizInfo: { field: 2, type: 'message' as const, schema: NTV2ExtBizInfoSchema },
} satisfies ProtoSchema;
export const NTV2UploadRespBodySchema = {
uKey: { field: 1, type: 'string' as const },
uKeyTtl: { field: 2, type: 'uint32' as const },
ipv4s: { field: 3, type: 'repeated_message' as const, schema: NTV2IPv4Schema },
msgSeq: { field: 5, type: 'uint64' as const },
msgInfo: { field: 6, type: 'message' as const, schema: NTV2UploadRespMsgInfoSchema },
subFileInfos: { field: 10, type: 'repeated_message' as const, schema: NTV2SubFileInfoRespSchema },
} satisfies ProtoSchema;
export const NTV2UploadRespHeadSchema = {
common: { field: 1, type: 'message' as const, schema: NTV2CommonHeadSchema },
retCode: { field: 2, type: 'uint32' as const },
message: { field: 3, type: 'string' as const },
} satisfies ProtoSchema;
export const NTV2UploadRichMediaRespSchema = {
respHead: { field: 1, type: 'message' as const, schema: NTV2UploadRespHeadSchema },
upload: { field: 2, type: 'message' as const, schema: NTV2UploadRespBodySchema },
} satisfies ProtoSchema;
+68
View File
@@ -0,0 +1,68 @@
import type { ProtoSchema } from '../../protobuf/decode';
import { PushMsgBodySchema } from './message';
export const LongMsgUidSchema = {
uid: { field: 2, type: 'string' as const },
} satisfies ProtoSchema;
export const LongMsgSettingsSchema = {
field1: { field: 1, type: 'uint32' as const },
field2: { field: 2, type: 'uint32' as const },
field3: { field: 3, type: 'uint32' as const },
field4: { field: 4, type: 'uint32' as const },
} satisfies ProtoSchema;
export const SendLongMsgInfoSchema = {
type: { field: 1, type: 'uint32' as const },
uid: { field: 2, type: 'message' as const, schema: LongMsgUidSchema },
groupUin: { field: 3, type: 'uint32' as const },
payload: { field: 4, type: 'bytes' as const },
} satisfies ProtoSchema;
export const SendLongMsgReqSchema = {
info: { field: 2, type: 'message' as const, schema: SendLongMsgInfoSchema },
settings: { field: 15, type: 'message' as const, schema: LongMsgSettingsSchema },
} satisfies ProtoSchema;
export const SendLongMsgRespResultSchema = {
resId: { field: 3, type: 'string' as const },
} satisfies ProtoSchema;
export const SendLongMsgRespSchema = {
result: { field: 2, type: 'message' as const, schema: SendLongMsgRespResultSchema },
settings: { field: 15, type: 'message' as const, schema: LongMsgSettingsSchema },
} satisfies ProtoSchema;
export const RecvLongMsgInfoSchema = {
uid: { field: 1, type: 'message' as const, schema: LongMsgUidSchema },
resId: { field: 2, type: 'string' as const },
acquire: { field: 3, type: 'bool' as const },
} satisfies ProtoSchema;
export const RecvLongMsgReqSchema = {
info: { field: 1, type: 'message' as const, schema: RecvLongMsgInfoSchema },
settings: { field: 15, type: 'message' as const, schema: LongMsgSettingsSchema },
} satisfies ProtoSchema;
export const RecvLongMsgRespResultSchema = {
resId: { field: 3, type: 'string' as const },
payload: { field: 4, type: 'bytes' as const },
} satisfies ProtoSchema;
export const RecvLongMsgRespSchema = {
result: { field: 1, type: 'message' as const, schema: RecvLongMsgRespResultSchema },
settings: { field: 15, type: 'message' as const, schema: LongMsgSettingsSchema },
} satisfies ProtoSchema;
export const LongMsgContentSchema = {
msgBody: { field: 1, type: 'repeated_message' as const, schema: PushMsgBodySchema },
} satisfies ProtoSchema;
export const LongMsgActionSchema = {
actionCommand: { field: 1, type: 'string' as const },
actionData: { field: 2, type: 'message' as const, schema: LongMsgContentSchema },
} satisfies ProtoSchema;
export const LongMsgResultSchema = {
action: { field: 2, type: 'repeated_message' as const, schema: LongMsgActionSchema },
} satisfies ProtoSchema;
+113
View File
@@ -0,0 +1,113 @@
// Proto schemas for message envelopes (PushMsg).
// Port of src/bridge/include/bridge/proto/message.h
import type { ProtoSchema } from '../../protobuf/decode';
import { ElemSchema } from './element';
// --- ResponseHead.Grp ---
export const ResponseGrpSchema = {
groupUin: { field: 1, type: 'uint32' as const },
memberName: { field: 2, type: 'string' as const },
groupName: { field: 4, type: 'string' as const },
} satisfies ProtoSchema;
export const ResponseForwardSchema = {
friendName: { field: 6, type: 'string' as const },
} satisfies ProtoSchema;
// --- ResponseHead ---
export const ResponseHeadSchema = {
fromUin: { field: 1, type: 'uint32' as const },
fromUid: { field: 2, type: 'string' as const },
type: { field: 3, type: 'uint32' as const },
sigMap: { field: 4, type: 'uint32' as const },
toUin: { field: 5, type: 'uint32' as const },
toUid: { field: 6, type: 'string' as const },
forward: { field: 7, type: 'message' as const, schema: ResponseForwardSchema },
grp: { field: 8, type: 'message' as const, schema: ResponseGrpSchema },
} satisfies ProtoSchema;
// --- ContentHead ---
export const ContentHeadSchema = {
msgType: { field: 1, type: 'uint32' as const },
subType: { field: 2, type: 'uint32' as const },
divSeq: { field: 3, type: 'uint32' as const },
msgId: { field: 4, type: 'uint32' as const },
sequence: { field: 5, type: 'uint32' as const },
timestamp: { field: 6, type: 'uint32' as const },
field7: { field: 7, type: 'uint64' as const },
newId: { field: 12, type: 'uint64' as const },
} satisfies ProtoSchema;
// --- Ptt (voice) ---
export const PttSchema = {
fileType: { field: 1, type: 'uint32' as const },
fileId: { field: 2, type: 'uint64' as const },
fileUuid: { field: 3, type: 'bytes' as const },
fileMd5: { field: 4, type: 'bytes' as const },
fileName: { field: 5, type: 'string' as const },
fileSize: { field: 6, type: 'uint32' as const },
groupFileKey: { field: 10, type: 'string' as const },
fileKey: { field: 14, type: 'bytes' as const },
time: { field: 19, type: 'uint32' as const },
format: { field: 29, type: 'uint32' as const },
} satisfies ProtoSchema;
// --- NotOnlineFile (C2C file) ---
export const NotOnlineFileSchema = {
fileType: { field: 1, type: 'uint32' as const },
fileUuid: { field: 3, type: 'string' as const },
fileMd5: { field: 4, type: 'bytes' as const },
fileName: { field: 5, type: 'string' as const },
fileSize: { field: 6, type: 'uint64' as const },
fileHash: { field: 57, type: 'string' as const },
} satisfies ProtoSchema;
// --- RichText ---
export const RichTextSchema = {
elems: { field: 2, type: 'repeated_message' as const, schema: ElemSchema },
notOnlineFile: { field: 3, type: 'message' as const, schema: NotOnlineFileSchema },
ptt: { field: 4, type: 'message' as const, schema: PttSchema },
} satisfies ProtoSchema;
// --- MessageBody ---
export const MessageBodySchema = {
richText: { field: 1, type: 'message' as const, schema: RichTextSchema },
msgContent: { field: 2, type: 'bytes' as const },
} satisfies ProtoSchema;
// --- FileExtra (for C2C file in msg_content) ---
export const FileExtraInfoSchema = {
fileSize: { field: 1, type: 'uint64' as const },
fileName: { field: 2, type: 'string' as const },
fileMd5: { field: 3, type: 'bytes' as const },
fileUuid: { field: 4, type: 'string' as const },
fileHash: { field: 5, type: 'string' as const },
} satisfies ProtoSchema;
export const FileExtraSchema = {
file: { field: 1, type: 'message' as const, schema: FileExtraInfoSchema },
} satisfies ProtoSchema;
// --- PushMsgBody ---
export const PushMsgBodySchema = {
responseHead: { field: 1, type: 'message' as const, schema: ResponseHeadSchema },
contentHead: { field: 2, type: 'message' as const, schema: ContentHeadSchema },
body: { field: 3, type: 'message' as const, schema: MessageBodySchema },
} satisfies ProtoSchema;
// --- PushMsg (top-level) ---
export const PushMsgSchema = {
message: { field: 1, type: 'message' as const, schema: PushMsgBodySchema },
status: { field: 3, type: 'int32' as const },
} satisfies ProtoSchema;
+207
View File
@@ -0,0 +1,207 @@
// Proto schemas for notification types.
// Port of src/bridge/include/bridge/proto/notify.h
import type { ProtoSchema } from '../../protobuf/decode';
export const OperatorField1Schema = {
uid: { field: 1, type: 'string' as const },
field2: { field: 2, type: 'uint32' as const },
field3: { field: 3, type: 'bytes' as const },
field4: { field: 4, type: 'uint32' as const },
field5: { field: 5, type: 'bytes' as const },
} satisfies ProtoSchema;
export const OperatorInfoSchema = {
operatorField: { field: 1, type: 'message' as const, schema: OperatorField1Schema },
} satisfies ProtoSchema;
export const GroupChangeSchema = {
groupUin: { field: 1, type: 'uint32' as const },
flag: { field: 2, type: 'uint32' as const },
memberUid: { field: 3, type: 'string' as const },
decreaseType: { field: 4, type: 'uint32' as const },
operatorBytes: { field: 5, type: 'bytes' as const },
increaseType: { field: 6, type: 'uint32' as const },
field7: { field: 7, type: 'bytes' as const },
} satisfies ProtoSchema;
export const GroupAdminExtraSchema = {
adminUid: { field: 1, type: 'string' as const },
isPromote: { field: 2, type: 'bool' as const },
} satisfies ProtoSchema;
export const GroupAdminBodySchema = {
extraDisable: { field: 1, type: 'message' as const, schema: GroupAdminExtraSchema },
extraEnable: { field: 2, type: 'message' as const, schema: GroupAdminExtraSchema },
} satisfies ProtoSchema;
export const GroupAdminSchema = {
groupUin: { field: 1, type: 'uint32' as const },
flag: { field: 2, type: 'uint32' as const },
isPromote: { field: 3, type: 'bool' as const },
body: { field: 4, type: 'message' as const, schema: GroupAdminBodySchema },
} satisfies ProtoSchema;
export const InvitationInnerSchema = {
groupUin: { field: 1, type: 'uint32' as const },
field2: { field: 2, type: 'uint32' as const },
field3: { field: 3, type: 'uint32' as const },
field4: { field: 4, type: 'uint32' as const },
targetUid: { field: 5, type: 'string' as const },
invitorUid: { field: 6, type: 'string' as const },
field7: { field: 7, type: 'uint32' as const },
field9: { field: 9, type: 'uint32' as const },
field10: { field: 10, type: 'bytes' as const },
field11: { field: 11, type: 'uint32' as const },
field12: { field: 12, type: 'string' as const },
} satisfies ProtoSchema;
export const InvitationInfoSchema = {
inner: { field: 1, type: 'message' as const, schema: InvitationInnerSchema },
} satisfies ProtoSchema;
export const GroupInvitationSchema = {
cmd: { field: 1, type: 'int32' as const },
info: { field: 2, type: 'message' as const, schema: InvitationInfoSchema },
} satisfies ProtoSchema;
export const GroupInviteSchema = {
groupUin: { field: 1, type: 'uint32' as const },
field2: { field: 2, type: 'uint32' as const },
field3: { field: 3, type: 'uint32' as const },
field4: { field: 4, type: 'uint32' as const },
invitorUid: { field: 5, type: 'string' as const },
hashes: { field: 6, type: 'bytes' as const },
} satisfies ProtoSchema;
export const GroupJoinSchema = {
groupUin: { field: 1, type: 'uint32' as const },
field2: { field: 2, type: 'uint32' as const },
targetUid: { field: 3, type: 'string' as const },
field4: { field: 4, type: 'uint32' as const },
field6: { field: 6, type: 'uint32' as const },
field7: { field: 7, type: 'string' as const },
field8: { field: 8, type: 'uint32' as const },
field9: { field: 9, type: 'bytes' as const },
} satisfies ProtoSchema;
export const FriendRequestInfoSchema = {
targetUid: { field: 1, type: 'string' as const },
sourceUid: { field: 2, type: 'string' as const },
newSource: { field: 5, type: 'string' as const },
message: { field: 10, type: 'string' as const },
source: { field: 11, type: 'string' as const },
} satisfies ProtoSchema;
export const FriendRequestSchema = {
info: { field: 1, type: 'message' as const, schema: FriendRequestInfoSchema },
} satisfies ProtoSchema;
export const FriendRecallTipInfoSchema = {
tip: { field: 2, type: 'string' as const },
} satisfies ProtoSchema;
export const FriendRecallInfoSchema = {
fromUid: { field: 1, type: 'string' as const },
toUid: { field: 2, type: 'string' as const },
clientSequence: { field: 3, type: 'uint32' as const },
newId: { field: 4, type: 'uint64' as const },
time: { field: 5, type: 'uint32' as const },
random: { field: 6, type: 'uint32' as const },
pkgNum: { field: 7, type: 'uint32' as const },
pkgIndex: { field: 8, type: 'uint32' as const },
divSeq: { field: 9, type: 'uint32' as const },
tipInfo: { field: 13, type: 'message' as const, schema: FriendRecallTipInfoSchema },
} satisfies ProtoSchema;
export const FriendRecallSchema = {
info: { field: 1, type: 'message' as const, schema: FriendRecallInfoSchema },
instId: { field: 2, type: 'uint32' as const },
appId: { field: 3, type: 'uint32' as const },
longMessageFlag: { field: 4, type: 'uint32' as const },
reserved: { field: 5, type: 'bytes' as const },
} satisfies ProtoSchema;
export const GroupMuteStateSchema = {
targetUid: { field: 1, type: 'string' as const },
duration: { field: 2, type: 'uint32' as const },
} satisfies ProtoSchema;
export const GroupMuteDataSchema = {
timestamp: { field: 1, type: 'uint32' as const },
type: { field: 2, type: 'uint32' as const },
state: { field: 3, type: 'message' as const, schema: GroupMuteStateSchema },
} satisfies ProtoSchema;
export const GroupMuteSchema = {
groupUin: { field: 1, type: 'uint32' as const },
subType: { field: 2, type: 'uint32' as const },
field3: { field: 3, type: 'uint32' as const },
operatorUid: { field: 4, type: 'string' as const },
data: { field: 5, type: 'message' as const, schema: GroupMuteDataSchema },
} satisfies ProtoSchema;
export const RecallMessageSchema = {
sequence: { field: 1, type: 'uint32' as const },
time: { field: 2, type: 'uint32' as const },
random: { field: 3, type: 'uint32' as const },
type: { field: 4, type: 'uint32' as const },
flag: { field: 5, type: 'uint32' as const },
authorUid: { field: 6, type: 'string' as const },
} satisfies ProtoSchema;
export const GroupRecallTipInfoSchema = {
tip: { field: 2, type: 'string' as const },
} satisfies ProtoSchema;
export const GroupRecallSchema = {
operatorUid: { field: 1, type: 'string' as const },
recallMessages: { field: 3, type: 'repeated_message' as const, schema: RecallMessageSchema },
userDef: { field: 5, type: 'bytes' as const },
groupType: { field: 6, type: 'int32' as const },
opType: { field: 7, type: 'int32' as const },
tipInfo: { field: 9, type: 'message' as const, schema: GroupRecallTipInfoSchema },
} satisfies ProtoSchema;
export const TemplParamSchema = {
name: { field: 1, type: 'string' as const },
value: { field: 2, type: 'string' as const },
} satisfies ProtoSchema;
export const GeneralGrayTipInfoSchema = {
busiType: { field: 1, type: 'uint64' as const },
busiId: { field: 2, type: 'uint64' as const },
ctrlFlag: { field: 3, type: 'uint32' as const },
c2cType: { field: 4, type: 'uint32' as const },
serviceType: { field: 5, type: 'uint32' as const },
templId: { field: 6, type: 'uint64' as const },
msgTemplParam: { field: 7, type: 'repeated_message' as const, schema: TemplParamSchema },
content: { field: 8, type: 'string' as const },
} satisfies ProtoSchema;
export const EssenceMessageSchema = {
groupUin: { field: 1, type: 'uint32' as const },
msgSequence: { field: 2, type: 'uint32' as const },
random: { field: 3, type: 'uint32' as const },
setFlag: { field: 4, type: 'uint32' as const },
memberUin: { field: 5, type: 'uint32' as const },
operatorUin: { field: 6, type: 'uint32' as const },
timestamp: { field: 7, type: 'uint32' as const },
msgSequence2: { field: 8, type: 'uint32' as const },
operatorNickname: { field: 9, type: 'string' as const },
memberNickname: { field: 10, type: 'string' as const },
setFlag2: { field: 11, type: 'uint32' as const },
} satisfies ProtoSchema;
export const NotifyMessageBodySchema = {
type: { field: 1, type: 'uint32' as const },
groupUin: { field: 4, type: 'uint32' as const },
eventParam: { field: 5, type: 'bytes' as const },
recall: { field: 11, type: 'message' as const, schema: GroupRecallSchema },
field13: { field: 13, type: 'uint32' as const },
operatorUid: { field: 21, type: 'string' as const },
generalGrayTip: { field: 26, type: 'message' as const, schema: GeneralGrayTipInfoSchema },
essenceMessage: { field: 33, type: 'message' as const, schema: EssenceMessageSchema },
msgSequence: { field: 37, type: 'uint32' as const },
field39: { field: 39, type: 'uint32' as const },
} satisfies ProtoSchema;
@@ -0,0 +1,788 @@
// Proto schemas for OIDB action requests.
// Port of src/bridge/include/bridge/proto/oidb.h (action-related structs)
// and src/bridge/src/bridge.cpp (recall message structs)
import type { ProtoSchema } from '../../protobuf/decode';
// --- 0x1253_1: Mute group member ---
export const OidbMuteMemberBodySchema = {
targetUid: { field: 1, type: 'string' as const },
duration: { field: 2, type: 'uint32' as const },
} satisfies ProtoSchema;
export const OidbMuteMemberSchema = {
groupUin: { field: 1, type: 'uint32' as const },
type: { field: 2, type: 'uint32' as const },
body: { field: 3, type: 'message' as const, schema: OidbMuteMemberBodySchema },
} satisfies ProtoSchema;
// --- 0x89A_0: Mute group all ---
export const OidbMuteAllStateSchema = {
state: { field: 17, type: 'uint32' as const },
} satisfies ProtoSchema;
export const OidbMuteAllSchema = {
groupUin: { field: 1, type: 'uint32' as const },
muteState: { field: 2, type: 'message' as const, schema: OidbMuteAllStateSchema },
} satisfies ProtoSchema;
// --- 0x8A0_1: Kick group member ---
export const OidbKickMemberSchema = {
groupUin: { field: 1, type: 'uint32' as const },
targetUid: { field: 3, type: 'string' as const },
rejectAddRequest:{ field: 4, type: 'bool' as const },
reason: { field: 5, type: 'string' as const },
} satisfies ProtoSchema;
// --- 0x1097_1: Leave group ---
export const OidbLeaveGroupSchema = {
groupUin: { field: 1, type: 'uint32' as const },
} satisfies ProtoSchema;
// --- 0xB5D_44: Friend add request ---
export const OidbFriendRequestActionSchema = {
accept: { field: 1, type: 'uint32' as const },
targetUid: { field: 2, type: 'string' as const },
} satisfies ProtoSchema;
// --- 0x126B_0: Delete friend ---
export const OidbDeleteFriendField2Field3Schema = {
field1: { field: 1, type: 'uint32' as const },
field2: { field: 2, type: 'uint32' as const },
field3: { field: 3, type: 'uint32' as const },
} satisfies ProtoSchema;
export const OidbDeleteFriendField2Schema = {
field1: { field: 1, type: 'uint32' as const },
field2: { field: 2, type: 'uint32' as const },
field3: { field: 3, type: 'message' as const, schema: OidbDeleteFriendField2Field3Schema },
} satisfies ProtoSchema;
export const OidbDeleteFriendField1Schema = {
targetUid: { field: 1, type: 'string' as const },
field2: { field: 2, type: 'message' as const, schema: OidbDeleteFriendField2Schema },
block: { field: 3, type: 'bool' as const },
field4: { field: 4, type: 'bool' as const },
} satisfies ProtoSchema;
export const OidbDeleteFriendSchema = {
field1: { field: 1, type: 'message' as const, schema: OidbDeleteFriendField1Schema },
} satisfies ProtoSchema;
// --- 0x10C8: Group request action ---
export const OidbGroupRequestBodySchema = {
sequence: { field: 1, type: 'uint64' as const },
eventType: { field: 2, type: 'uint32' as const },
groupUin: { field: 3, type: 'uint32' as const },
message: { field: 4, type: 'string' as const },
} satisfies ProtoSchema;
export const OidbGroupRequestActionSchema = {
accept: { field: 1, type: 'uint32' as const },
body: { field: 2, type: 'message' as const, schema: OidbGroupRequestBodySchema },
} satisfies ProtoSchema;
// --- 0xED3_1: Poke ---
export const OidbPokeSchema = {
uin: { field: 1, type: 'uint32' as const },
groupUin: { field: 2, type: 'uint32' as const },
friendUin: { field: 5, type: 'uint32' as const },
ext: { field: 6, type: 'uint32' as const },
} satisfies ProtoSchema;
// --- 0xEAC: Group essence ---
export const OidbEssenceSchema = {
groupUin: { field: 1, type: 'uint32' as const },
sequence: { field: 2, type: 'uint32' as const },
random: { field: 3, type: 'uint32' as const },
} satisfies ProtoSchema;
// --- 0x1096_1: Set group admin ---
export const OidbSetAdminSchema = {
groupUin: { field: 1, type: 'uint32' as const },
uid: { field: 2, type: 'string' as const },
isAdmin: { field: 3, type: 'bool' as const },
} satisfies ProtoSchema;
// --- 0x8FC_3: Set group card (rename member) ---
export const OidbRenameMemberBodySchema = {
targetUid: { field: 1, type: 'string' as const },
targetName: { field: 2, type: 'string' as const },
} satisfies ProtoSchema;
export const OidbRenameMemberSchema = {
groupUin: { field: 1, type: 'uint32' as const },
body: { field: 2, type: 'message' as const, schema: OidbRenameMemberBodySchema },
} satisfies ProtoSchema;
// --- 0x89A_15: Rename group ---
export const OidbRenameGroupBodySchema = {
targetName: { field: 1, type: 'string' as const },
} satisfies ProtoSchema;
export const OidbRenameGroupSchema = {
groupUin: { field: 1, type: 'uint32' as const },
body: { field: 2, type: 'message' as const, schema: OidbRenameGroupBodySchema },
} satisfies ProtoSchema;
// --- 0x8FC_2: Set group special title ---
export const OidbSpecialTitleBodySchema = {
targetUid: { field: 1, type: 'string' as const },
specialTitle:{ field: 5, type: 'string' as const },
expireTime: { field: 6, type: 'int32' as const },
} satisfies ProtoSchema;
export const OidbSpecialTitleSchema = {
groupUin: { field: 1, type: 'uint32' as const },
body: { field: 2, type: 'message' as const, schema: OidbSpecialTitleBodySchema },
} satisfies ProtoSchema;
// --- 0x7E5_104: Send like ---
export const OidbLikeSchema = {
targetUin: { field: 1, type: 'uint32' as const },
count: { field: 2, type: 'uint32' as const },
} satisfies ProtoSchema;
// --- 0x10C0_1 / 0x10C0_2: Group request list ---
export const OidbGroupRequestListSchema = {
count: { field: 1, type: 'uint32' as const },
field2: { field: 2, type: 'uint32' as const },
} satisfies ProtoSchema;
// --- 0xFE1_2: User profile info ---
export const OidbUserInfoKeySchema = {
key: { field: 1, type: 'uint32' as const },
} satisfies ProtoSchema;
export const OidbUserInfoRequestSchema = {
uin: { field: 1, type: 'uint32' as const },
field2: { field: 2, type: 'uint32' as const },
keys: { field: 3, type: 'repeated_message' as const, schema: OidbUserInfoKeySchema },
} satisfies ProtoSchema;
export const OidbTwoNumberSchema = {
number1: { field: 1, type: 'uint32' as const },
number2: { field: 2, type: 'uint32' as const },
} satisfies ProtoSchema;
export const OidbBytePropertySchema = {
code: { field: 1, type: 'uint32' as const },
value: { field: 2, type: 'bytes' as const },
} satisfies ProtoSchema;
export const OidbUserInfoPropertySchema = {
numberProperties: { field: 1, type: 'repeated_message' as const, schema: OidbTwoNumberSchema },
bytesProperties: { field: 2, type: 'repeated_message' as const, schema: OidbBytePropertySchema },
} satisfies ProtoSchema;
export const OidbUserInfoResponseBodySchema = {
uid: { field: 1, type: 'string' as const },
properties: { field: 2, type: 'message' as const, schema: OidbUserInfoPropertySchema },
uin: { field: 3, type: 'uint32' as const },
} satisfies ProtoSchema;
export const OidbUserInfoResponseSchema = {
body: { field: 1, type: 'message' as const, schema: OidbUserInfoResponseBodySchema },
} satisfies ProtoSchema;
export const AvatarInfoSchema = {
url: { field: 5, type: 'string' as const },
} satisfies ProtoSchema;
// --- FD4_1: Friend list request body fields ---
export const OidbFriendListNumberSchema = {
numbers: { field: 1, type: 'repeated_uint32' as const },
} satisfies ProtoSchema;
export const OidbFriendListBodyItemSchema = {
type: { field: 1, type: 'uint32' as const },
number: { field: 2, type: 'message' as const, schema: OidbFriendListNumberSchema },
} satisfies ProtoSchema;
export const OidbFriendListNextUinSchema = {
uin: { field: 1, type: 'uint32' as const },
} satisfies ProtoSchema;
export const OidbFriendListRequestSchema = {
friendCount: { field: 2, type: 'uint32' as const },
field4: { field: 4, type: 'uint32' as const },
nextUin: { field: 5, type: 'message' as const, schema: OidbFriendListNextUinSchema },
field6: { field: 6, type: 'uint32' as const },
field7: { field: 7, type: 'uint32' as const },
body: { field: 10001, type: 'repeated_message' as const, schema: OidbFriendListBodyItemSchema },
field10002: { field: 10002, type: 'repeated_uint32' as const },
field10003: { field: 10003, type: 'uint32' as const },
} satisfies ProtoSchema;
// --- FE5_2: Group list request body (config fields) ---
export const OidbGroupListConfig1Schema = {
groupOwner: { field: 1, type: 'bool' as const },
field2: { field: 2, type: 'bool' as const },
memberMax: { field: 3, type: 'bool' as const },
memberCount: { field: 4, type: 'bool' as const },
groupName: { field: 5, type: 'bool' as const },
field8: { field: 8, type: 'bool' as const },
field9: { field: 9, type: 'bool' as const },
field10: { field: 10, type: 'bool' as const },
field11: { field: 11, type: 'bool' as const },
field12: { field: 12, type: 'bool' as const },
field13: { field: 13, type: 'bool' as const },
field14: { field: 14, type: 'bool' as const },
field15: { field: 15, type: 'bool' as const },
field16: { field: 16, type: 'bool' as const },
field17: { field: 17, type: 'bool' as const },
field18: { field: 18, type: 'bool' as const },
question: { field: 19, type: 'bool' as const },
field20: { field: 20, type: 'bool' as const },
field22: { field: 22, type: 'bool' as const },
field23: { field: 23, type: 'bool' as const },
field24: { field: 24, type: 'bool' as const },
field25: { field: 25, type: 'bool' as const },
field26: { field: 26, type: 'bool' as const },
field27: { field: 27, type: 'bool' as const },
field28: { field: 28, type: 'bool' as const },
field29: { field: 29, type: 'bool' as const },
field30: { field: 30, type: 'bool' as const },
field31: { field: 31, type: 'bool' as const },
field32: { field: 32, type: 'bool' as const },
field5001: { field: 5001, type: 'bool' as const },
field5002: { field: 5002, type: 'bool' as const },
field5003: { field: 5003, type: 'bool' as const },
} satisfies ProtoSchema;
export const OidbGroupListConfig2Schema = {
field1: { field: 1, type: 'bool' as const },
field2: { field: 2, type: 'bool' as const },
field3: { field: 3, type: 'bool' as const },
field4: { field: 4, type: 'bool' as const },
field5: { field: 5, type: 'bool' as const },
field6: { field: 6, type: 'bool' as const },
field7: { field: 7, type: 'bool' as const },
field8: { field: 8, type: 'bool' as const },
} satisfies ProtoSchema;
export const OidbGroupListConfig3Schema = {
field5: { field: 5, type: 'bool' as const },
field6: { field: 6, type: 'bool' as const },
} satisfies ProtoSchema;
export const OidbGroupListConfigSchema = {
config1: { field: 1, type: 'message' as const, schema: OidbGroupListConfig1Schema },
config2: { field: 2, type: 'message' as const, schema: OidbGroupListConfig2Schema },
config3: { field: 3, type: 'message' as const, schema: OidbGroupListConfig3Schema },
} satisfies ProtoSchema;
export const OidbGroupListRequestSchema = {
config: { field: 1, type: 'message' as const, schema: OidbGroupListConfigSchema },
} satisfies ProtoSchema;
// --- FE7_3: Group member list request body ---
export const OidbGroupMemberListBodySchema = {
memberName: { field: 10, type: 'bool' as const },
memberCard: { field: 11, type: 'bool' as const },
level: { field: 12, type: 'bool' as const },
field13: { field: 13, type: 'bool' as const },
field16: { field: 16, type: 'bool' as const },
specialTitle: { field: 17, type: 'bool' as const },
field18: { field: 18, type: 'bool' as const },
field20: { field: 20, type: 'bool' as const },
field21: { field: 21, type: 'bool' as const },
joinTimestamp: { field: 100, type: 'bool' as const },
lastMsgTimestamp: { field: 101, type: 'bool' as const },
shutUpTimestamp: { field: 102, type: 'bool' as const },
field103: { field: 103, type: 'bool' as const },
field104: { field: 104, type: 'bool' as const },
field105: { field: 105, type: 'bool' as const },
field106: { field: 106, type: 'bool' as const },
permission: { field: 107, type: 'bool' as const },
field200: { field: 200, type: 'bool' as const },
field201: { field: 201, type: 'bool' as const },
} satisfies ProtoSchema;
export const OidbGroupMemberListRequestSchema = {
groupUin: { field: 1, type: 'uint32' as const },
field2: { field: 2, type: 'uint32' as const },
field3: { field: 3, type: 'uint32' as const },
body: { field: 4, type: 'message' as const, schema: OidbGroupMemberListBodySchema },
token: { field: 15, type: 'string' as const },
} satisfies ProtoSchema;
// --- Group recall message (trpc.msg.msg_svc.MsgService.SsoGroupRecallMsg) ---
export const GroupRecallInfoSchema = {
sequence: { field: 1, type: 'uint32' as const },
random: { field: 2, type: 'uint32' as const },
field3: { field: 3, type: 'uint32' as const },
} satisfies ProtoSchema;
export const GroupRecallSettingsSchema = {
field1: { field: 1, type: 'uint32' as const },
} satisfies ProtoSchema;
export const GroupRecallRequestSchema = {
type: { field: 1, type: 'uint32' as const },
groupUin: { field: 2, type: 'uint32' as const },
info: { field: 3, type: 'message' as const, schema: GroupRecallInfoSchema },
settings: { field: 4, type: 'message' as const, schema: GroupRecallSettingsSchema },
} satisfies ProtoSchema;
// --- C2C (private) recall message (trpc.msg.msg_svc.MsgService.SsoC2CRecallMsg) ---
export const C2CRecallInfoSchema = {
clientSequence: { field: 1, type: 'uint32' as const },
random: { field: 2, type: 'uint32' as const },
messageId: { field: 3, type: 'uint64' as const },
timestamp: { field: 4, type: 'uint32' as const },
field5: { field: 5, type: 'uint32' as const },
messageSequence: { field: 6, type: 'uint32' as const },
} satisfies ProtoSchema;
export const C2CRecallSettingsSchema = {
field1: { field: 1, type: 'bool' as const },
field2: { field: 2, type: 'bool' as const },
} satisfies ProtoSchema;
export const C2CRecallRequestSchema = {
type: { field: 1, type: 'uint32' as const },
targetUid:{ field: 3, type: 'string' as const },
info: { field: 4, type: 'message' as const, schema: C2CRecallInfoSchema },
settings: { field: 5, type: 'message' as const, schema: C2CRecallSettingsSchema },
field6: { field: 6, type: 'bool' as const },
} satisfies ProtoSchema;
// --- 0x9082_1: Set group reaction ---
export const OidbGroupReactionSchema = {
groupUin: { field: 1, type: 'uint32' as const },
sequence: { field: 2, type: 'uint32' as const },
code: { field: 3, type: 'string' as const },
} satisfies ProtoSchema;
// --- 0x6D8_1: Group file list ---
export const OidbGroupFileListReqSchema = {
groupUin: { field: 1, type: 'uint32' as const },
appId: { field: 2, type: 'uint32' as const },
targetDirectory: { field: 3, type: 'string' as const },
fileCount: { field: 5, type: 'uint32' as const },
sortBy: { field: 9, type: 'uint32' as const },
startIndex: { field: 13, type: 'uint32' as const },
field17: { field: 17, type: 'uint32' as const },
field18: { field: 18, type: 'uint32' as const },
} satisfies ProtoSchema;
export const OidbGroupFileViewReqSchema = {
list: { field: 2, type: 'message' as const, schema: OidbGroupFileListReqSchema },
} satisfies ProtoSchema;
export const OidbGroupFileListFolderRespSchema = {
folderId: { field: 1, type: 'string' as const },
parentDirectoryId: { field: 2, type: 'string' as const },
folderName: { field: 3, type: 'string' as const },
createTime: { field: 4, type: 'uint32' as const },
modifiedTime: { field: 5, type: 'uint32' as const },
creatorUin: { field: 6, type: 'uint32' as const },
creatorName: { field: 7, type: 'string' as const },
totalFileCount: { field: 8, type: 'uint32' as const },
} satisfies ProtoSchema;
export const OidbGroupFileListFileRespSchema = {
fileId: { field: 1, type: 'string' as const },
fileName: { field: 2, type: 'string' as const },
fileSize: { field: 3, type: 'uint64' as const },
busId: { field: 4, type: 'uint32' as const },
uploadedTime: { field: 6, type: 'uint32' as const },
expireTime: { field: 7, type: 'uint32' as const },
modifiedTime: { field: 8, type: 'uint32' as const },
downloadedTimes: { field: 9, type: 'uint32' as const },
uploaderName: { field: 14, type: 'string' as const },
uploaderUin: { field: 15, type: 'uint32' as const },
parentDirectory: { field: 16, type: 'string' as const },
} satisfies ProtoSchema;
export const OidbGroupFileListItemRespSchema = {
type: { field: 1, type: 'uint32' as const },
folderInfo: { field: 2, type: 'message' as const, schema: OidbGroupFileListFolderRespSchema },
fileInfo: { field: 3, type: 'message' as const, schema: OidbGroupFileListFileRespSchema },
} satisfies ProtoSchema;
export const OidbGroupFileListRespSchema = {
retCode: { field: 1, type: 'uint32' as const },
retMsg: { field: 2, type: 'string' as const },
clientWording: { field: 3, type: 'string' as const },
isEnd: { field: 4, type: 'bool' as const },
items: { field: 5, type: 'repeated_message' as const, schema: OidbGroupFileListItemRespSchema },
} satisfies ProtoSchema;
export const OidbGroupFileViewRespSchema = {
list: { field: 2, type: 'message' as const, schema: OidbGroupFileListRespSchema },
} satisfies ProtoSchema;
// --- 0x6D6_2 / 0x6D6_3: Group file url & delete ---
export const OidbGroupFileUploadReqSchema = {
groupUin: { field: 1, type: 'uint32' as const },
appId: { field: 2, type: 'uint32' as const },
busId: { field: 3, type: 'uint32' as const },
entrance: { field: 4, type: 'uint32' as const },
targetDirectory: { field: 5, type: 'string' as const },
fileName: { field: 6, type: 'string' as const },
localDirectory: { field: 7, type: 'string' as const },
fileSize: { field: 8, type: 'uint64' as const },
fileSha1: { field: 9, type: 'bytes' as const },
fileSha3: { field: 10, type: 'bytes' as const },
fileMd5: { field: 11, type: 'bytes' as const },
field15: { field: 15, type: 'bool' as const },
} satisfies ProtoSchema;
export const OidbGroupFileDownloadReqSchema = {
groupUin: { field: 1, type: 'uint32' as const },
appId: { field: 2, type: 'uint32' as const },
busId: { field: 3, type: 'uint32' as const },
fileId: { field: 4, type: 'string' as const },
} satisfies ProtoSchema;
export const OidbGroupFileDeleteReqSchema = {
groupUin: { field: 1, type: 'uint32' as const },
busId: { field: 3, type: 'uint32' as const },
fileId: { field: 5, type: 'string' as const },
} satisfies ProtoSchema;
export const OidbGroupFileMoveReqSchema = {
groupUin: { field: 1, type: 'uint32' as const },
appId: { field: 2, type: 'uint32' as const },
busId: { field: 3, type: 'uint32' as const },
fileId: { field: 4, type: 'string' as const },
parentDirectory: { field: 5, type: 'string' as const },
targetDirectory: { field: 6, type: 'string' as const },
} satisfies ProtoSchema;
export const OidbGroupFileReqSchema = {
file: { field: 1, type: 'message' as const, schema: OidbGroupFileUploadReqSchema },
download: { field: 3, type: 'message' as const, schema: OidbGroupFileDownloadReqSchema },
delete: { field: 4, type: 'message' as const, schema: OidbGroupFileDeleteReqSchema },
move: { field: 6, type: 'message' as const, schema: OidbGroupFileMoveReqSchema },
} satisfies ProtoSchema;
export const OidbGroupFileUploadRespSchema = {
retCode: { field: 1, type: 'int32' as const },
retMsg: { field: 2, type: 'string' as const },
clientWording: { field: 3, type: 'string' as const },
uploadIp: { field: 4, type: 'string' as const },
serverDns: { field: 5, type: 'string' as const },
busId: { field: 6, type: 'int32' as const },
fileId: { field: 7, type: 'string' as const },
checkKey: { field: 8, type: 'bytes' as const },
fileKey: { field: 9, type: 'bytes' as const },
boolFileExist: { field: 10, type: 'bool' as const },
uploadPort: { field: 14, type: 'uint32' as const },
} satisfies ProtoSchema;
export const OidbGroupFileDownloadRespSchema = {
retCode: { field: 1, type: 'uint32' as const },
retMsg: { field: 2, type: 'string' as const },
clientWording: { field: 3, type: 'string' as const },
downloadIp: { field: 4, type: 'string' as const },
downloadDns: { field: 5, type: 'string' as const },
downloadUrl: { field: 6, type: 'bytes' as const },
saveFileName: { field: 11, type: 'string' as const },
} satisfies ProtoSchema;
export const OidbGroupFileRetRespSchema = {
retCode: { field: 1, type: 'uint32' as const },
retMsg: { field: 2, type: 'string' as const },
clientWording: { field: 3, type: 'string' as const },
} satisfies ProtoSchema;
export const OidbGroupFileRespSchema = {
upload: { field: 1, type: 'message' as const, schema: OidbGroupFileUploadRespSchema },
download: { field: 3, type: 'message' as const, schema: OidbGroupFileDownloadRespSchema },
delete: { field: 4, type: 'message' as const, schema: OidbGroupFileRetRespSchema },
move: { field: 6, type: 'message' as const, schema: OidbGroupFileRetRespSchema },
} satisfies ProtoSchema;
// --- 0x6D7_0 / 0x6D7_1 / 0x6D7_2: Group file folder ops ---
export const OidbGroupFileCreateFolderReqSchema = {
groupUin: { field: 1, type: 'uint32' as const },
rootDirectory: { field: 3, type: 'string' as const },
folderName: { field: 4, type: 'string' as const },
} satisfies ProtoSchema;
export const OidbGroupFileDeleteFolderReqSchema = {
groupUin: { field: 1, type: 'uint32' as const },
folderId: { field: 3, type: 'string' as const },
} satisfies ProtoSchema;
export const OidbGroupFileRenameFolderReqSchema = {
groupUin: { field: 1, type: 'uint32' as const },
folderId: { field: 3, type: 'string' as const },
newFolderName: { field: 4, type: 'string' as const },
} satisfies ProtoSchema;
export const OidbGroupFileFolderReqSchema = {
create: { field: 1, type: 'message' as const, schema: OidbGroupFileCreateFolderReqSchema },
delete: { field: 2, type: 'message' as const, schema: OidbGroupFileDeleteFolderReqSchema },
rename: { field: 3, type: 'message' as const, schema: OidbGroupFileRenameFolderReqSchema },
} satisfies ProtoSchema;
export const OidbGroupFileFolderRetRespSchema = {
retcode: { field: 1, type: 'uint32' as const },
retMsg: { field: 2, type: 'string' as const },
clientWording: { field: 3, type: 'string' as const },
} satisfies ProtoSchema;
export const OidbGroupFileFolderRespSchema = {
create: { field: 1, type: 'message' as const, schema: OidbGroupFileFolderRetRespSchema },
delete: { field: 2, type: 'message' as const, schema: OidbGroupFileFolderRetRespSchema },
rename: { field: 3, type: 'message' as const, schema: OidbGroupFileFolderRetRespSchema },
} satisfies ProtoSchema;
// --- 0xE37_1200: Private file download url ---
export const OidbPrivateFileDownloadReqBodySchema = {
receiverUid: { field: 10, type: 'string' as const },
fileUuid: { field: 20, type: 'string' as const },
type: { field: 30, type: 'uint32' as const },
fileHash: { field: 60, type: 'string' as const },
t2: { field: 601, type: 'uint32' as const },
} satisfies ProtoSchema;
export const OidbPrivateFileDownloadReqSchema = {
subCommand: { field: 1, type: 'uint32' as const },
field2: { field: 2, type: 'uint32' as const },
body: { field: 14, type: 'message' as const, schema: OidbPrivateFileDownloadReqBodySchema },
field101: { field: 101, type: 'uint32' as const },
field102: { field: 102, type: 'uint32' as const },
field200: { field: 200, type: 'uint32' as const },
field99999: { field: 99999, type: 'bytes' as const },
} satisfies ProtoSchema;
export const OidbPrivateFileDownloadRespResultSchema = {
server: { field: 20, type: 'string' as const },
port: { field: 40, type: 'uint32' as const },
url: { field: 50, type: 'string' as const },
} satisfies ProtoSchema;
export const OidbPrivateFileDownloadRespBodySchema = {
state: { field: 20, type: 'string' as const },
result: { field: 30, type: 'message' as const, schema: OidbPrivateFileDownloadRespResultSchema },
} satisfies ProtoSchema;
export const OidbPrivateFileDownloadRespSchema = {
body: { field: 14, type: 'message' as const, schema: OidbPrivateFileDownloadRespBodySchema },
} satisfies ProtoSchema;
// --- 0xE37_1700: Private file upload ---
export const OidbPrivateFileUploadReqBodySchema = {
senderUid: { field: 10, type: 'string' as const },
receiverUid: { field: 20, type: 'string' as const },
fileSize: { field: 30, type: 'uint32' as const },
fileName: { field: 40, type: 'string' as const },
md510MCheckSum:{ field: 50, type: 'bytes' as const },
sha1CheckSum: { field: 60, type: 'bytes' as const },
localPath: { field: 70, type: 'string' as const },
md5CheckSum: { field: 110, type: 'bytes' as const },
sha3CheckSum: { field: 120, type: 'bytes' as const },
} satisfies ProtoSchema;
export const OidbPrivateFileUploadReqSchema = {
command: { field: 1, type: 'uint32' as const },
seq: { field: 2, type: 'int32' as const },
upload: { field: 19, type: 'message' as const, schema: OidbPrivateFileUploadReqBodySchema },
businessId: { field: 101, type: 'int32' as const },
clientType: { field: 102, type: 'int32' as const },
flagSupportMediaPlatform: { field: 200, type: 'int32' as const },
} satisfies ProtoSchema;
export const OidbPrivateFileUploadRespBodySchema = {
retCode: { field: 10, type: 'int32' as const },
retMsg: { field: 20, type: 'string' as const },
uploadIp: { field: 60, type: 'string' as const },
uploadPort: { field: 80, type: 'uint32' as const },
uuid: { field: 90, type: 'string' as const },
uploadKey: { field: 100, type: 'bytes' as const },
boolFileExist: { field: 110, type: 'bool' as const },
fileAddon: { field: 200, type: 'string' as const },
mediaPlatformUploadKey: { field: 220, type: 'bytes' as const },
} satisfies ProtoSchema;
export const OidbPrivateFileUploadRespSchema = {
upload: { field: 19, type: 'message' as const, schema: OidbPrivateFileUploadRespBodySchema },
} satisfies ProtoSchema;
// --- NTV2 Rich Media (0x9067_202): Download RKey ---
export const NTV2CommonHeadSchema = {
requestId: { field: 1, type: 'uint32' as const },
command: { field: 2, type: 'uint32' as const },
} satisfies ProtoSchema;
export const NTV2C2CUserInfoSchema = {
accountType: { field: 1, type: 'uint32' as const },
targetUid: { field: 2, type: 'string' as const },
} satisfies ProtoSchema;
export const NTV2GroupInfoSchema = {
groupUin: { field: 1, type: 'uint32' as const },
} satisfies ProtoSchema;
export const NTV2SceneInfoSchema = {
requestType: { field: 101, type: 'uint32' as const },
businessType: { field: 102, type: 'uint32' as const },
sceneType: { field: 200, type: 'uint32' as const },
c2c: { field: 201, type: 'message' as const, schema: NTV2C2CUserInfoSchema },
group: { field: 202, type: 'message' as const, schema: NTV2GroupInfoSchema },
} satisfies ProtoSchema;
export const NTV2ClientMetaSchema = {
agentType: { field: 1, type: 'uint32' as const },
} satisfies ProtoSchema;
export const NTV2ReqHeadSchema = {
common: { field: 1, type: 'message' as const, schema: NTV2CommonHeadSchema },
scene: { field: 2, type: 'message' as const, schema: NTV2SceneInfoSchema },
client: { field: 3, type: 'message' as const, schema: NTV2ClientMetaSchema },
} satisfies ProtoSchema;
export const NTV2DownloadRKeyReqSchema = {
types: { field: 1, type: 'repeated_uint32' as const },
} satisfies ProtoSchema;
export const NTV2FileTypeSchema = {
type: { field: 1, type: 'uint32' as const },
picFormat: { field: 2, type: 'uint32' as const },
videoFormat: { field: 3, type: 'uint32' as const },
voiceFormat: { field: 4, type: 'uint32' as const },
} satisfies ProtoSchema;
export const NTV2FileInfoSchema = {
fileSize: { field: 1, type: 'uint32' as const },
fileHash: { field: 2, type: 'string' as const },
fileSha1: { field: 3, type: 'string' as const },
fileName: { field: 4, type: 'string' as const },
type: { field: 5, type: 'message' as const, schema: NTV2FileTypeSchema },
width: { field: 6, type: 'uint32' as const },
height: { field: 7, type: 'uint32' as const },
time: { field: 8, type: 'uint32' as const },
original: { field: 9, type: 'uint32' as const },
} satisfies ProtoSchema;
export const NTV2IndexNodeSchema = {
info: { field: 1, type: 'message' as const, schema: NTV2FileInfoSchema },
fileUuid: { field: 2, type: 'string' as const },
storeId: { field: 3, type: 'uint32' as const },
uploadTime: { field: 4, type: 'uint32' as const },
ttl: { field: 5, type: 'uint32' as const },
subType: { field: 6, type: 'uint32' as const },
} satisfies ProtoSchema;
export const NTV2VideoDownloadExtSchema = {
busiType: { field: 1, type: 'uint32' as const },
sceneType: { field: 2, type: 'uint32' as const },
subBusiType: { field: 3, type: 'uint32' as const },
} satisfies ProtoSchema;
export const NTV2DownloadExtSchema = {
video: { field: 2, type: 'message' as const, schema: NTV2VideoDownloadExtSchema },
} satisfies ProtoSchema;
export const NTV2DownloadReqSchema = {
node: { field: 1, type: 'message' as const, schema: NTV2IndexNodeSchema },
download: { field: 2, type: 'message' as const, schema: NTV2DownloadExtSchema },
} satisfies ProtoSchema;
export const NTV2RichMediaReqSchema = {
reqHead: { field: 1, type: 'message' as const, schema: NTV2ReqHeadSchema },
download: { field: 3, type: 'message' as const, schema: NTV2DownloadReqSchema },
downloadRkey: { field: 4, type: 'message' as const, schema: NTV2DownloadRKeyReqSchema },
} satisfies ProtoSchema;
export const NTV2RespHeadSchema = {
common: { field: 1, type: 'message' as const, schema: NTV2CommonHeadSchema },
retCode: { field: 2, type: 'uint32' as const },
message: { field: 3, type: 'string' as const },
} satisfies ProtoSchema;
export const NTV2RKeyInfoSchema = {
rkey: { field: 1, type: 'string' as const },
rkeyTtlSec: { field: 2, type: 'uint64' as const },
storeId: { field: 3, type: 'uint32' as const },
rkeyCreateTime:{ field: 4, type: 'uint32' as const },
type: { field: 5, type: 'uint32' as const },
} satisfies ProtoSchema;
export const NTV2DownloadRKeyRespSchema = {
rkeys: { field: 1, type: 'repeated_message' as const, schema: NTV2RKeyInfoSchema },
} satisfies ProtoSchema;
export const NTV2MediaDownloadInfoSchema = {
domain: { field: 1, type: 'string' as const },
urlPath: { field: 2, type: 'string' as const },
httpsPort: { field: 3, type: 'uint32' as const },
} satisfies ProtoSchema;
export const NTV2MediaDownloadRespSchema = {
rKeyParam: { field: 1, type: 'string' as const },
rKeyTtlSecond: { field: 2, type: 'uint32' as const },
info: { field: 3, type: 'message' as const, schema: NTV2MediaDownloadInfoSchema },
rKeyCreateTime: { field: 4, type: 'uint32' as const },
} satisfies ProtoSchema;
export const NTV2RichMediaRespSchema = {
respHead: { field: 1, type: 'message' as const, schema: NTV2RespHeadSchema },
download: { field: 3, type: 'message' as const, schema: NTV2MediaDownloadRespSchema },
downloadRkey:{ field: 4, type: 'message' as const, schema: NTV2DownloadRKeyRespSchema },
} satisfies ProtoSchema;
// --- 0xB6E_2: Set friend remark ---
export const OidbSetFriendRemarkSchema = {
targetUid: { field: 1, type: 'string' as const },
remark: { field: 2, type: 'string' as const },
} satisfies ProtoSchema;
// --- 0x9082_2: Set group reaction (remove) — same schema as set ---
// (0x9082_1 for add, 0x9082_2 for remove — both use OidbGroupReactionSchema)
// --- Group file count (0x6D8_3) ---
export const OidbGroupFileCountReqSchema = {
groupUin: { field: 1, type: 'uint32' as const },
appId: { field: 2, type: 'uint32' as const },
busId: { field: 3, type: 'uint32' as const },
} satisfies ProtoSchema;
export const OidbGroupFileCountRespSchema = {
fileCount: { field: 1, type: 'uint32' as const },
maxCount: { field: 2, type: 'uint32' as const },
isEnd: { field: 3, type: 'bool' as const },
} satisfies ProtoSchema;
export const OidbGroupFileCountViewReqSchema = {
count: { field: 3, type: 'message' as const, schema: OidbGroupFileCountReqSchema },
} satisfies ProtoSchema;
export const OidbGroupFileCountViewRespSchema = {
count: { field: 3, type: 'message' as const, schema: OidbGroupFileCountRespSchema },
} satisfies ProtoSchema;
+161
View File
@@ -0,0 +1,161 @@
// Proto schemas for OidbSvc service types.
// Port of src/bridge/include/bridge/proto/oidb.h
import type { ProtoSchema } from '../../protobuf/decode';
// --- OidbSvcTrpcTcpBase wrapper ---
export const OidbPropertySchema = {
key: { field: 1, type: 'string' as const },
value: { field: 2, type: 'bytes' as const },
} satisfies ProtoSchema;
// Factory for OidbSvcTrpcTcpBase<T>
export function makeOidbBaseSchema(bodySchema: ProtoSchema): ProtoSchema {
return {
command: { field: 1, type: 'uint32' as const },
subCommand: { field: 2, type: 'uint32' as const },
errorCode: { field: 3, type: 'uint32' as const },
body: { field: 4, type: 'message' as const, schema: bodySchema },
errorMsg: { field: 5, type: 'string' as const },
properties: { field: 11, type: 'repeated_message' as const, schema: OidbPropertySchema },
reserved: { field: 12, type: 'int32' as const },
};
}
// --- Friend list (0xFD4_1) ---
export const OidbFriendPropertySchema = {
code: { field: 1, type: 'uint32' as const },
value: { field: 2, type: 'string' as const },
} satisfies ProtoSchema;
export const OidbFriendLayer1Schema = {
properties: { field: 2, type: 'repeated_message' as const, schema: OidbFriendPropertySchema },
} satisfies ProtoSchema;
export const OidbFriendAdditionalSchema = {
type: { field: 1, type: 'uint32' as const },
layer1: { field: 2, type: 'message' as const, schema: OidbFriendLayer1Schema },
} satisfies ProtoSchema;
export const OidbFriendSchema = {
uid: { field: 1, type: 'string' as const },
customGroup:{ field: 2, type: 'uint32' as const },
uin: { field: 3, type: 'uint32' as const },
additional: { field: 10001, type: 'repeated_message' as const, schema: OidbFriendAdditionalSchema },
} satisfies ProtoSchema;
export const OidbSvcTrpcTcp0xFD4_1ResponseUinSchema = {
uin: { field: 1, type: 'uint32' as const },
} satisfies ProtoSchema;
export const OidbSvcTrpcTcp0xFD4_1ResponseSchema = {
next: { field: 2, type: 'message' as const, schema: OidbSvcTrpcTcp0xFD4_1ResponseUinSchema },
displayFriendCount: { field: 3, type: 'uint32' as const },
timestamp: { field: 6, type: 'uint32' as const },
selfUin: { field: 7, type: 'uint32' as const },
friends: { field: 101, type: 'repeated_message' as const, schema: OidbFriendSchema },
groups: { field: 102, type: 'repeated_message' as const, schema: OidbFriendPropertySchema },
} satisfies ProtoSchema;
// --- Group list (0xFE5_2) ---
export const OidbSvcTrpcTcp0xFE5_2MemberSchema = {
uid: { field: 2, type: 'string' as const },
} satisfies ProtoSchema;
export const OidbSvcTrpcTcp0xFE5_2GroupInfoSchema = {
groupOwner: { field: 1, type: 'message' as const, schema: OidbSvcTrpcTcp0xFE5_2MemberSchema },
createdTime: { field: 2, type: 'uint32' as const },
memberMax: { field: 3, type: 'uint32' as const },
memberCount: { field: 4, type: 'uint32' as const },
groupName: { field: 5, type: 'string' as const },
description: { field: 18, type: 'string' as const },
question: { field: 19, type: 'string' as const },
announcement: { field: 30, type: 'string' as const },
} satisfies ProtoSchema;
export const OidbSvcTrpcTcp0xFE5_2CustomInfoSchema = {
remark: { field: 3, type: 'string' as const },
} satisfies ProtoSchema;
export const OidbSvcTrpcTcp0xFE5_2GroupSchema = {
groupUin: { field: 3, type: 'uint32' as const },
info: { field: 4, type: 'message' as const, schema: OidbSvcTrpcTcp0xFE5_2GroupInfoSchema },
customInfo: { field: 5, type: 'message' as const, schema: OidbSvcTrpcTcp0xFE5_2CustomInfoSchema },
} satisfies ProtoSchema;
export const OidbSvcTrpcTcp0xFE5_2ResponseSchema = {
groups: { field: 2, type: 'repeated_message' as const, schema: OidbSvcTrpcTcp0xFE5_2GroupSchema },
} satisfies ProtoSchema;
// --- Group member list (0xFE7_3) ---
export const OidbSvcTrpcTcp0xFE7_3UinSchema = {
uid: { field: 2, type: 'string' as const },
uin: { field: 4, type: 'uint32' as const },
} satisfies ProtoSchema;
export const OidbSvcTrpcTcp0xFE7_3CardSchema = {
memberCard: { field: 2, type: 'string' as const },
} satisfies ProtoSchema;
export const OidbSvcTrpcTcp0xFE7_3LevelSchema = {
infos: { field: 1, type: 'repeated_uint32' as const },
level: { field: 2, type: 'uint32' as const },
} satisfies ProtoSchema;
export const OidbSvcTrpcTcp0xFE7_3MemberSchema = {
uin: { field: 1, type: 'message' as const, schema: OidbSvcTrpcTcp0xFE7_3UinSchema },
memberName: { field: 10, type: 'string' as const },
specialTitle: { field: 17, type: 'string' as const },
memberCard: { field: 11, type: 'message' as const, schema: OidbSvcTrpcTcp0xFE7_3CardSchema },
level: { field: 12, type: 'message' as const, schema: OidbSvcTrpcTcp0xFE7_3LevelSchema },
joinTimestamp: { field: 100, type: 'uint32' as const },
lastMsgTimestamp: { field: 101, type: 'uint32' as const },
shutUpTimestamp: { field: 102, type: 'uint32' as const },
permission: { field: 107, type: 'uint32' as const },
} satisfies ProtoSchema;
export const OidbSvcTrpcTcp0xFE7_3ResponseSchema = {
groupUin: { field: 1, type: 'uint32' as const },
members: { field: 2, type: 'repeated_message' as const, schema: OidbSvcTrpcTcp0xFE7_3MemberSchema },
field3: { field: 3, type: 'uint32' as const },
memberChangeSeq: { field: 5, type: 'uint32' as const },
memberCardChangeSeq:{ field: 6, type: 'uint32' as const },
token: { field: 15, type: 'string' as const },
} satisfies ProtoSchema;
// --- Group request (0x10C0) ---
export const OidbSvcTrpcTcp0x10C0ResponseUserSchema = {
uid: { field: 1, type: 'string' as const },
name: { field: 2, type: 'string' as const },
} satisfies ProtoSchema;
export const OidbSvcTrpcTcp0x10C0ResponseGroupSchema = {
groupUin: { field: 1, type: 'uint32' as const },
groupName: { field: 2, type: 'string' as const },
} satisfies ProtoSchema;
export const OidbSvcTrpcTcp0x10C0ResponseRequestSchema = {
sequence: { field: 1, type: 'uint64' as const },
eventType: { field: 2, type: 'uint32' as const },
state: { field: 3, type: 'uint32' as const },
group: { field: 4, type: 'message' as const, schema: OidbSvcTrpcTcp0x10C0ResponseGroupSchema },
target: { field: 5, type: 'message' as const, schema: OidbSvcTrpcTcp0x10C0ResponseUserSchema },
invitor: { field: 6, type: 'message' as const, schema: OidbSvcTrpcTcp0x10C0ResponseUserSchema },
operatorUser: { field: 7, type: 'message' as const, schema: OidbSvcTrpcTcp0x10C0ResponseUserSchema },
field9: { field: 9, type: 'string' as const },
comment: { field: 10, type: 'string' as const },
} satisfies ProtoSchema;
export const OidbSvcTrpcTcp0x10C0ResponseSchema = {
requests: { field: 1, type: 'repeated_message' as const, schema: OidbSvcTrpcTcp0x10C0ResponseRequestSchema },
field2: { field: 2, type: 'uint64' as const },
newLatestSeq: { field: 3, type: 'uint64' as const },
field4: { field: 4, type: 'uint32' as const },
field5: { field: 5, type: 'uint64' as const },
field6: { field: 6, type: 'uint32' as const },
} satisfies ProtoSchema;