Skip to content

Commit 10d863e

Browse files
committed
Corrected UnionMessageReply type for downstream consumption
1 parent 475270d commit 10d863e

File tree

3 files changed

+5
-18
lines changed

3 files changed

+5
-18
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tbd54566975/dwn-sdk-js",
3-
"version": "0.5.0",
3+
"version": "0.5.1",
44
"description": "A reference implementation of https://identity.foundation/decentralized-web-node/spec/",
55
"repository": {
66
"type": "git",

src/core/message-reply.ts

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import type { MessagesReadReplyEntry } from '../types/messages-types.js';
22
import type { PaginationCursor } from '../types/query-types.js';
33
import 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';
65
import type { GenericMessageReply, MessageSubscription, QueryResultEntry } from '../types/message-types.js';
76

87
export 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

Comments
 (0)