diff --git a/packages/web5-agent/src/web5-agent.ts b/packages/web5-agent/src/web5-agent.ts index 3f55b1f03..b1d1f8f6b 100644 --- a/packages/web5-agent/src/web5-agent.ts +++ b/packages/web5-agent/src/web5-agent.ts @@ -1,14 +1,14 @@ import type { Readable } from 'readable-stream'; import { - MessageReply, - RecordsQueryMessage, - ProtocolsQueryMessage, - ProtocolsConfigureMessage, EventsGetMessage, + UnionMessageReply, MessagesGetMessage, + RecordsQueryMessage, RecordsWriteMessage, - RecordsDeleteMessage + RecordsDeleteMessage, + ProtocolsQueryMessage, + ProtocolsConfigureMessage, } from '@tbd54566975/dwn-sdk-js'; export interface Web5Agent { @@ -51,7 +51,7 @@ export type SendDwnRequest = DwnRequest & (ProcessDwnRequest | { messageCid: str export type DwnResponse = { message?: unknown; messageCid?: string; - reply: MessageReply; + reply: UnionMessageReply; }; @@ -97,4 +97,4 @@ export type DwnRpcRequest = { /** * TODO: add jsdoc */ -export type DwnRpcResponse = MessageReply; \ No newline at end of file +export type DwnRpcResponse = UnionMessageReply; \ No newline at end of file diff --git a/packages/web5-user-agent/src/web5-user-agent.ts b/packages/web5-user-agent/src/web5-user-agent.ts index 8bc4c5fd9..2b7698762 100644 --- a/packages/web5-user-agent/src/web5-user-agent.ts +++ b/packages/web5-user-agent/src/web5-user-agent.ts @@ -1,29 +1,29 @@ import type { DwnServiceEndpoint } from '@tbd54566975/dids'; import { + DataStream, SignatureInput, - RecordsWriteOptions, - RecordsWriteMessage, - PrivateJwk as DwnPrivateKeyJwk, MessagesGetReply, - DataStream, RecordsReadReply, - MessageReply, + UnionMessageReply, + RecordsWriteMessage, + RecordsWriteOptions, + PrivateJwk as DwnPrivateKeyJwk, } from '@tbd54566975/dwn-sdk-js'; import { Readable } from 'readable-stream'; import { DwnRpc, Web5Agent, - DwnRpcRequest, - ProcessDwnRequest, DwnResponse, + DwnRpcRequest, SendDwnRequest, + ProcessDwnRequest, } from '@tbd54566975/web5-agent'; import { Cid, Encoder, - Message + Message, } from '@tbd54566975/dwn-sdk-js'; import type { SyncManager } from './sync-manager.js'; @@ -111,7 +111,7 @@ export class Web5UserAgent implements Web5Agent { async processDwnRequest(request: ProcessDwnRequest): Promise { const { message, dataStream }= await this.#constructDwnMessage(request); - let reply: MessageReply; + let reply: UnionMessageReply; if (request.store !== false) { reply = await this.dwn.processMessage(request.target, message, dataStream as any); } else { diff --git a/packages/web5/src/dwn-api.ts b/packages/web5/src/dwn-api.ts index 5781c87db..66228e05a 100644 --- a/packages/web5/src/dwn-api.ts +++ b/packages/web5/src/dwn-api.ts @@ -1,16 +1,16 @@ import type { Web5Agent } from '@tbd54566975/web5-agent'; import type { - MessageReply, - ProtocolsConfigureDescriptor, - ProtocolsConfigureOptions, - ProtocolsQueryOptions, - RecordsDeleteOptions, - RecordsQueryOptions, - RecordsQueryReplyEntry, + UnionMessageReply, RecordsReadOptions, + RecordsQueryOptions, RecordsWriteMessage, RecordsWriteOptions, - ProtocolsConfigureMessage + RecordsDeleteOptions, + ProtocolsQueryOptions, + RecordsQueryReplyEntry, + ProtocolsConfigureMessage, + ProtocolsConfigureOptions, + ProtocolsConfigureDescriptor, } from '@tbd54566975/dwn-sdk-js'; import { DwnInterfaceName, DwnMethodName } from '@tbd54566975/dwn-sdk-js'; @@ -24,7 +24,7 @@ export type ProtocolsConfigureRequest = { } export type ProtocolsConfigureResponse = { - status: MessageReply['status']; + status: UnionMessageReply['status']; protocol?: Protocol; } @@ -39,7 +39,7 @@ export type ProtocolsQueryRequest = { export type ProtocolsQueryResponse = { protocols: Protocol[]; - status: MessageReply['status']; + status: UnionMessageReply['status']; } export type RecordsCreateRequest = RecordsWriteRequest; @@ -59,7 +59,7 @@ export type RecordsDeleteRequest = { } export type RecordsDeleteResponse = { - status: MessageReply['status']; + status: UnionMessageReply['status']; }; export type RecordsQueryRequest = { @@ -69,7 +69,7 @@ export type RecordsQueryRequest = { } export type RecordsQueryResponse = { - status: MessageReply['status']; + status: UnionMessageReply['status']; records?: Record[] }; @@ -80,7 +80,7 @@ export type RecordsReadRequest = { } export type RecordsReadResponse = { - status: MessageReply['status']; + status: UnionMessageReply['status']; record: Record; }; @@ -91,7 +91,7 @@ export type RecordsWriteRequest = { } export type RecordsWriteResponse = { - status: MessageReply['status']; + status: UnionMessageReply['status']; record?: Record };