( hybrid: HybridTransport, )
| 76 | * has a single type. |
| 77 | */ |
| 78 | export function createV1ReplTransport( |
| 79 | hybrid: HybridTransport, |
| 80 | ): ReplBridgeTransport { |
| 81 | return { |
| 82 | write: msg => hybrid.write(msg), |
| 83 | writeBatch: msgs => hybrid.writeBatch(msgs), |
| 84 | close: () => hybrid.close(), |
| 85 | isConnectedStatus: () => hybrid.isConnectedStatus(), |
| 86 | getStateLabel: () => hybrid.getStateLabel(), |
| 87 | setOnData: cb => hybrid.setOnData(cb), |
| 88 | setOnClose: cb => hybrid.setOnClose(cb), |
| 89 | setOnConnect: cb => hybrid.setOnConnect(cb), |
| 90 | connect: () => void hybrid.connect(), |
| 91 | // v1 Session-Ingress WS doesn't use SSE sequence numbers; replay |
| 92 | // semantics are different. Always return 0 so the seq-num carryover |
| 93 | // logic in replBridge is a no-op for v1. |
| 94 | getLastSequenceNum: () => 0, |
| 95 | get droppedBatchCount() { |
| 96 | return hybrid.droppedBatchCount |
| 97 | }, |
| 98 | reportState: () => {}, |
| 99 | reportMetadata: () => {}, |
| 100 | reportDelivery: () => {}, |
| 101 | flush: () => Promise.resolve(), |
| 102 | } |
| 103 | } |
| 104 | |
| 105 | /** |
| 106 | * v2 adapter: wrap SSETransport (reads) + CCRClient (writes, heartbeat, |
no test coverage detected