refactor(oidb): migrate profile.ts OIDB cmds to namespaces
5 of profile.ts's methods were thin OIDB wrappers — migrated to the
new namespace pattern. The 5 non-OIDB methods (setOnlineStatus /
setDiyOnlineStatus / setAvatar / setGroupAvatar / fetchCustomFace)
stay on the facade unchanged — they hit `trpc.qq_new_tech.*`,
Highway, or `Faceroam.OpReq` directly and aren't in scope for the
OIDB-namespace refactor.
New namespaces (each with focused Pick<BridgeContext, …> deps):
- SetProfile (0x112A_2) — needs identity for uin
- SetSelfLongNick (0x112A_2) — same cmd different proto, ditto
- SetInputStatus (0xCD4_1) — needs resolveUserUid
- GetLike (0x7ED_12) — needs identity + resolveUserUid
- GetUnidirectionalFriendList (0xE17_0) — needs identity; non-standard
wire name handled via the new
wireName override on OidbCallSpec
Infrastructure tweak:
- OidbCallSpec gains an optional `wireName(cmd, sub) → string`. Most
cmds use the default `OidbSvcTrpcTcp.0xNNNN_N` scheme; 0xe17_0
routes through `MQUpdateSvc_com_qq_ti.web.OidbSvc.0xe17_0`.
Test mock updates:
- profile.test.ts moves the migrated cmds onto bridge.sendRawPacket
mock (the new path bypasses the bridge-oidb runOidb mock). Non-OIDB
cmds (setOnlineStatus, setAvatar, etc.) keep their existing mocks.
- 36 new namespace-level tests in @snowluma/bridge covering serialize
branches, deserialize edge cases, deps resolution, and e2e wire
routing.
Verification:
- pnpm -r typecheck: green
- @snowluma/bridge: 12 files / 118 tests
- @snowluma/core: 33 files / 302 tests
Wire shape unchanged across migrated cmds — same bytes produced.
This commit is contained in:
14 files changed
+760
-154
No files matched your search
@@ -63,6 +63,26 @@
|
||||
"types": "./src/oidb-services/interaction/set-essence.ts",
|
||||
"default": "./src/oidb-services/interaction/set-essence.ts"
|
||||
},
|
||||
"./oidb-services/profile/set-profile": {
|
||||
"types": "./src/oidb-services/profile/set-profile.ts",
|
||||
"default": "./src/oidb-services/profile/set-profile.ts"
|
||||
},
|
||||
"./oidb-services/profile/set-self-long-nick": {
|
||||
"types": "./src/oidb-services/profile/set-self-long-nick.ts",
|
||||
"default": "./src/oidb-services/profile/set-self-long-nick.ts"
|
||||
},
|
||||
"./oidb-services/profile/set-input-status": {
|
||||
"types": "./src/oidb-services/profile/set-input-status.ts",
|
||||
"default": "./src/oidb-services/profile/set-input-status.ts"
|
||||
},
|
||||
"./oidb-services/profile/get-like": {
|
||||
"types": "./src/oidb-services/profile/get-like.ts",
|
||||
"default": "./src/oidb-services/profile/get-like.ts"
|
||||
},
|
||||
"./oidb-services/profile/get-unidirectional-friend-list": {
|
||||
"types": "./src/oidb-services/profile/get-unidirectional-friend-list.ts",
|
||||
"default": "./src/oidb-services/profile/get-unidirectional-friend-list.ts"
|
||||
},
|
||||
"./bridge-context": {
|
||||
"types": "./src/bridge-context.ts",
|
||||
"default": "./src/bridge-context.ts"
|
||||
|
||||
Reference in new issue
Block a user