11import type { MessagesReadReplyEntry } from '../types/messages-types.js' ;
22import type { PaginationCursor } from '../types/query-types.js' ;
33import type { ProtocolsConfigureMessage } from '../types/protocols-types.js' ;
4- import type { Readable } from 'readable-stream' ;
5- import type { RecordsWriteMessage } from '../types/records-types.js' ;
4+ import type { RecordsReadReply } from '../types/records-types.js' ;
65import type { GenericMessageReply , MessageSubscription , QueryResultEntry } from '../types/message-types.js' ;
76
87export function messageReplyFromError ( e : unknown , code : number ) : GenericMessageReply {
@@ -15,7 +14,7 @@ export function messageReplyFromError(e: unknown, code: number): GenericMessageR
1514/**
1615 * Catch-all message reply type. It is recommended to use GenericMessageReply or a message-specific reply type wherever possible.
1716 */
18- export type UnionMessageReply = GenericMessageReply & {
17+ export type UnionMessageReply = GenericMessageReply & RecordsReadReply & {
1918 /**
2019 * Resulting message entries or events returned from the invocation of the corresponding message.
2120 * e.g. the resulting messages from a RecordsQuery, or array of messageCid strings for MessagesQuery
@@ -29,18 +28,6 @@ export type UnionMessageReply = GenericMessageReply & {
2928 */
3029 entry ?: MessagesReadReplyEntry ;
3130
32- /**
33- * Record corresponding to the message received if applicable (e.g. RecordsRead).
34- * Mutually exclusive with `entries` and `cursor`.
35- */
36- record ?: RecordsWriteMessage & {
37- /**
38- * The initial write of the record if the returned RecordsWrite message itself is not the initial write.
39- */
40- initialWrite ?: RecordsWriteMessage ;
41- data : Readable ;
42- } ;
43-
4431 /**
4532 * A cursor for pagination if applicable (e.g. RecordsQuery).
4633 * Mutually exclusive with `record`.
0 commit comments