Reorder and normalize imports, add missing type imports, and fix whitespace/formatting across multiple files. Notable updates: eslint.config.ts import ordering; core bridge APIs (group-album, misc, web) now import Json types; tests/highway pipeline import ordering and added type imports; protocol changes (element-builder, highway client/pipeline) reorganized imports and added proto type imports; many oidb service modules moved protobuf encode/decode imports for consistency; web group modules (album, essence, honor, notice, request-util) reordered imports, adjusted typings/indentation, and small whitespace fixes. These edits are stylistic and typing improvements and should not change runtime behavior.
55 lines
2.2 KiB
TypeScript
55 lines
2.2 KiB
TypeScript
// 0xFE7_3 — single-page group-member-roster fetch.
|
|
//
|
|
// Pagination cursor is the server-issued `token` string. The facade
|
|
// drives the loop until `token` comes back empty; per-group caching
|
|
// + inflight coalescing also stays on the facade since both need
|
|
// state that's per-Bridge (and is what stops Tencent risk-control
|
|
// from banning the account on busy clients — see #42).
|
|
|
|
import type { OidbBase, OidbSvcTrpcTcp0xFE7_3Response } from '@snowluma/proto-defs/oidb';
|
|
import type { OidbGroupMemberListRequest } from '@snowluma/proto-defs/oidb-actions/base';
|
|
import { protobuf_decode, protobuf_encode } from '@snowluma/proton';
|
|
import { invokeOidb, type OidbSender } from '../../oidb-service';
|
|
|
|
export namespace FetchGroupMemberListPage {
|
|
export const command = 0xFE7;
|
|
export const subCommand = 3;
|
|
|
|
export interface Params {
|
|
groupId: number;
|
|
/** Empty string for the first page; pass the previous response's
|
|
* `token` to fetch the next page. */
|
|
token: string;
|
|
}
|
|
|
|
export type Deps = OidbSender;
|
|
|
|
export const serialize = (_ctx: Deps, p: Params): OidbGroupMemberListRequest => {
|
|
const body: OidbGroupMemberListRequest = {
|
|
groupUin: p.groupId,
|
|
field2: 5,
|
|
field3: 2,
|
|
body: {
|
|
memberName: true, memberCard: true, level: true, field13: true,
|
|
field16: true, specialTitle: true, field18: true, field20: true,
|
|
field21: true, joinTimestamp: true, lastMsgTimestamp: true,
|
|
shutUpTimestamp: true, field103: true, field104: true, field105: true,
|
|
field106: true, permission: true, field200: true, field201: true,
|
|
},
|
|
};
|
|
if (p.token) body.token = p.token;
|
|
return body;
|
|
};
|
|
|
|
export const deserialize = (_ctx: Deps, body: OidbSvcTrpcTcp0xFE7_3Response): OidbSvcTrpcTcp0xFE7_3Response => body;
|
|
|
|
export const encode = (env: OidbBase<OidbGroupMemberListRequest>): Uint8Array =>
|
|
protobuf_encode<OidbBase<OidbGroupMemberListRequest>>(env);
|
|
|
|
export const decode = (bytes: Uint8Array): OidbBase<OidbSvcTrpcTcp0xFE7_3Response> =>
|
|
protobuf_decode<OidbBase<OidbSvcTrpcTcp0xFE7_3Response>>(bytes);
|
|
|
|
export const invoke = (deps: Deps, params: Params): Promise<OidbSvcTrpcTcp0xFE7_3Response> =>
|
|
invokeOidb(deps, FetchGroupMemberListPage, params);
|
|
}
|