Remove bridge proto schemas and parity test
Delete proto schema modules under packages/core/src/bridge/proto (action.ts, element.ts, highway.ts, longmsg.ts, message.ts, notify.ts, oidb-action.ts, oidb.ts) and the related test packages/core/tests/proton-parity.test.ts. These files contained protobuf schema definitions for the bridge layer; remove them as part of a cleanup/refactor. Update any imports or references to these modules to their new locations or replacements.
This commit is contained in:
1 parent
02bab710b8
commit
5ea1c3a961
45 files changed
+1361
-4230
No files matched your search
@@ -10,6 +10,7 @@
|
||||
// network I/O.
|
||||
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import { protobuf_encode } from '@snowluma/proton';
|
||||
import { subscribeLogs, type LogEntry } from '../src/utils/logger';
|
||||
|
||||
vi.mock('../src/bridge/highway/highway-client', () => ({
|
||||
@@ -24,22 +25,18 @@ import {
|
||||
runNtv2Upload,
|
||||
type MediaSubFileUpload,
|
||||
} from '../src/bridge/highway/pipeline';
|
||||
import { protoEncode } from '../src/protobuf/decode';
|
||||
import { makeOidbBaseSchema } from '../src/bridge/proto/oidb';
|
||||
import {
|
||||
NTV2UploadRichMediaRespSchema,
|
||||
} from '../src/bridge/proto/highway';
|
||||
import type { OidbBase } from '../src/bridge/proto/proton/oidb';
|
||||
import type { NTV2UploadRichMediaResp } from '../src/bridge/proto/proton/highway';
|
||||
import { MsgPushRegistry } from '../src/bridge/msg-push/registry';
|
||||
import type { MsgPushContext } from '../src/bridge/msg-push/context';
|
||||
import { decodeEvent0x2DC } from '../src/bridge/msg-push/decoders/event-0x2dc';
|
||||
|
||||
function encodeOidbResponse(body: unknown): Buffer {
|
||||
const baseSchema = makeOidbBaseSchema(NTV2UploadRichMediaRespSchema);
|
||||
return Buffer.from(protoEncode({
|
||||
return Buffer.from(protobuf_encode<OidbBase<NTV2UploadRichMediaResp>>({
|
||||
command: 0x11C4, subCommand: 100, errorCode: 0,
|
||||
body: body as Record<string, unknown>,
|
||||
errorMsg: '', reserved: 1,
|
||||
}, baseSchema));
|
||||
} as OidbBase<NTV2UploadRichMediaResp>));
|
||||
}
|
||||
|
||||
function fakeBridge(responseData: Buffer, uin = '12345'): any {
|
||||
|
||||
Reference in new issue
Block a user