From 3b2e49420debc3080c033a3fbe960392ccccbebb Mon Sep 17 00:00:00 2001 From: Artemkaaas Date: Fri, 4 Aug 2023 10:12:43 +0300 Subject: [PATCH] fix: Export AgentMessage (DidCommV1Message) to keep backward compatibility Signed-off-by: Artemkaaas --- .../agent/{AgentMessage.ts => AgentBaseMessage.ts} | 2 +- packages/core/src/agent/Dispatcher.ts | 4 ++-- packages/core/src/agent/EnvelopeService.ts | 8 ++++---- packages/core/src/agent/Events.ts | 4 ++-- packages/core/src/agent/MessageReceiver.ts | 14 +++++++------- packages/core/src/agent/MessageSender.ts | 8 ++++---- packages/core/src/agent/TransportService.ts | 4 ++-- packages/core/src/agent/__tests__/stubs.ts | 4 ++-- .../core/src/agent/models/InboundMessageContext.ts | 4 ++-- .../src/agent/models/OutboundMessageContext.ts | 4 ++-- .../src/decorators/attachment/v1/Attachment.ts | 4 ++-- .../core/src/decorators/thread/ThreadDecorator.ts | 2 +- .../src/didcomm/versions/v1/DidCommV1Message.ts | 7 +++++-- packages/core/src/didcomm/versions/v1/helpers.ts | 4 ++-- packages/core/src/didcomm/versions/v1/index.ts | 2 +- .../src/didcomm/versions/v2/DidCommV2Message.ts | 4 ++-- packages/core/src/didcomm/versions/v2/helpers.ts | 4 ++-- packages/core/src/index.ts | 2 +- packages/core/src/modules/oob/OutOfBandApi.ts | 10 +++++++--- .../storage/didcomm/DidCommMessageRepository.ts | 4 ++-- packages/core/tests/connections.test.ts | 2 +- samples/extension-module/README.md | 2 +- .../dummy/messages/DummyRequestMessage.ts | 4 ++-- .../dummy/messages/DummyResponseMessage.ts | 4 ++-- 24 files changed, 59 insertions(+), 52 deletions(-) rename packages/core/src/agent/{AgentMessage.ts => AgentBaseMessage.ts} (95%) diff --git a/packages/core/src/agent/AgentMessage.ts b/packages/core/src/agent/AgentBaseMessage.ts similarity index 95% rename from packages/core/src/agent/AgentMessage.ts rename to packages/core/src/agent/AgentBaseMessage.ts index e60a556141..d6bd25de0e 100644 --- a/packages/core/src/agent/AgentMessage.ts +++ b/packages/core/src/agent/AgentBaseMessage.ts @@ -2,7 +2,7 @@ import type { ServiceDecorator } from '../decorators/service/ServiceDecorator' import type { ReturnRouteTypes } from '../decorators/transport/TransportDecorator' import type { DidCommMessageVersion } from '../didcomm/types' -export interface AgentMessage { +export interface AgentBaseMessage { readonly type: string get didCommVersion(): DidCommMessageVersion diff --git a/packages/core/src/agent/Dispatcher.ts b/packages/core/src/agent/Dispatcher.ts index a139beead8..eb0530bf18 100644 --- a/packages/core/src/agent/Dispatcher.ts +++ b/packages/core/src/agent/Dispatcher.ts @@ -1,4 +1,4 @@ -import type { AgentMessage } from './AgentMessage' +import type { AgentBaseMessage } from './AgentBaseMessage' import type { AgentMessageProcessedEvent } from './Events' import type { InboundMessageContext } from './models/InboundMessageContext' @@ -42,7 +42,7 @@ class Dispatcher { throw new AriesFrameworkError(`No handler for message type "${message.type}" found`) } - let outboundMessage: OutboundMessageContext | void + let outboundMessage: OutboundMessageContext | void try { outboundMessage = await messageHandler.handle(messageContext) diff --git a/packages/core/src/agent/EnvelopeService.ts b/packages/core/src/agent/EnvelopeService.ts index 4a1a7d133b..c90693a5ec 100644 --- a/packages/core/src/agent/EnvelopeService.ts +++ b/packages/core/src/agent/EnvelopeService.ts @@ -1,4 +1,4 @@ -import type { AgentMessage } from './AgentMessage' +import type { AgentBaseMessage } from './AgentBaseMessage' import type { AgentContext } from './context' import type { Key } from '../crypto' import type { @@ -41,7 +41,7 @@ export class EnvelopeService { public async packMessage( agentContext: AgentContext, - message: AgentMessage, + message: AgentBaseMessage, params: PackMessageParams ): Promise { if (message.didCommVersion === DidCommMessageVersion.V1) { @@ -110,7 +110,7 @@ export class EnvelopeService { private async packDIDCommV1Message( agentContext: AgentContext, - message: AgentMessage, + message: AgentBaseMessage, params: DidCommV1PackMessageParams ): Promise { const { recipientKeys, senderKey } = params @@ -170,7 +170,7 @@ export class EnvelopeService { private async packDIDCommV2Message( agentContext: AgentContext, - message: AgentMessage, + message: AgentBaseMessage, params: DidCommV2PackMessageParams ): Promise { const unboundMessage = message.toJSON() diff --git a/packages/core/src/agent/Events.ts b/packages/core/src/agent/Events.ts index 0eecc21fe4..b2df1030cb 100644 --- a/packages/core/src/agent/Events.ts +++ b/packages/core/src/agent/Events.ts @@ -1,4 +1,4 @@ -import type { AgentMessage } from './AgentMessage' +import type { AgentBaseMessage } from './AgentBaseMessage' import type { OutboundMessageContext, OutboundMessageSendStatus } from './models' import type { ConnectionRecord } from '../modules/connections' import type { Observable } from 'rxjs' @@ -39,7 +39,7 @@ export interface AgentMessageReceivedEvent extends BaseEvent { export interface AgentMessageProcessedEvent extends BaseEvent { type: typeof AgentEventTypes.AgentMessageProcessed payload: { - message: AgentMessage + message: AgentBaseMessage connection?: ConnectionRecord } } diff --git a/packages/core/src/agent/MessageReceiver.ts b/packages/core/src/agent/MessageReceiver.ts index 46e7729b06..a89da41750 100644 --- a/packages/core/src/agent/MessageReceiver.ts +++ b/packages/core/src/agent/MessageReceiver.ts @@ -1,4 +1,4 @@ -import type { AgentMessage } from './AgentMessage' +import type { AgentBaseMessage } from './AgentBaseMessage' import type { TransportSession } from './TransportService' import type { AgentContext } from './context' import type { EncryptedMessage, PlaintextMessage } from '../didcomm' @@ -169,7 +169,7 @@ export class MessageReceiver { // We want to save a session if there is a chance of returning outbound message via inbound transport. // That can happen when inbound message has `return_route` set to `all` or `thread`. - // If `return_route` defines just `thread`, we decide later whether to use session according to outbound message `threadId`. + // If `return_route` defines just `thread`, we decide later whether to use session according to outbound message `thid`. if (senderKey && recipientKey && message.hasAnyReturnRoute() && session) { this.logger.debug(`Storing session for inbound message '${message.id}'`) const keys = { @@ -197,8 +197,8 @@ export class MessageReceiver { agentContext: AgentContext, plaintextMessage: PlaintextMessage, connection?: ConnectionRecord | null - ): Promise { - let message: AgentMessage + ): Promise { + let message: AgentBaseMessage try { message = await this.transformMessage(plaintextMessage) } catch (error) { @@ -207,7 +207,7 @@ export class MessageReceiver { throw new AriesFrameworkError(`Not sending problem report in response to problem report: ${error.message}`) } - const problemReportMessage: AgentMessage | undefined = isPlaintextMessageV1(plaintextMessage) + const problemReportMessage: AgentBaseMessage | undefined = isPlaintextMessageV1(plaintextMessage) ? buildProblemReportV1Message(plaintextMessage, error.message) : buildProblemReportV2Message(plaintextMessage, error.message) @@ -279,7 +279,7 @@ export class MessageReceiver { * * @param message the plaintext message for which to transform the message in to a class instance */ - private async transformMessage(message: PlaintextMessage): Promise { + private async transformMessage(message: PlaintextMessage): Promise { // replace did:sov:BzCbsNYhMrjHiqZDTUASHg;spec prefix for message type with https://didcomm.org if (message['@type']) { // replace did:sov:BzCbsNYhMrjHiqZDTUASHg;spec prefix for record type with https://didcomm.org @@ -300,7 +300,7 @@ export class MessageReceiver { } // Cast the plain JSON object to specific instance of Message extended from AgentMessage - let messageTransformed: AgentMessage + let messageTransformed: AgentBaseMessage try { messageTransformed = JsonTransformer.fromJSON(message, MessageClass) } catch (error) { diff --git a/packages/core/src/agent/MessageSender.ts b/packages/core/src/agent/MessageSender.ts index 457ecd057d..7f98c4c63a 100644 --- a/packages/core/src/agent/MessageSender.ts +++ b/packages/core/src/agent/MessageSender.ts @@ -1,4 +1,4 @@ -import type { AgentMessage } from './AgentMessage' +import type { AgentBaseMessage } from './AgentBaseMessage' import type { PackMessageParams } from './EnvelopeService' import type { AgentMessageSentEvent } from './Events' import type { TransportSession } from './TransportService' @@ -86,7 +86,7 @@ export class MessageSender { endpoint, }: { params: PackMessageParams - message: AgentMessage + message: AgentBaseMessage endpoint: string } ): Promise { @@ -99,7 +99,7 @@ export class MessageSender { } } - private async sendMessageToSession(agentContext: AgentContext, session: TransportSession, message: AgentMessage) { + private async sendMessageToSession(agentContext: AgentContext, session: TransportSession, message: AgentBaseMessage) { this.logger.debug(`Existing ${session.type} transport session has been found.`) if (!session.keys) { throw new AriesFrameworkError(`There are no keys for the given ${session.type} transport session.`) @@ -517,7 +517,7 @@ export class MessageSender { } else if (outOfBand) { this.logger.debug(`Resolving services from out-of-band record ${outOfBand.id}.`) if (connection.isRequester) { - const services = outOfBand.outOfBandInvitation?.getServices() || [] + const services = outOfBand.getOutOfBandInvitation().getServices() || [] for (const service of services) { // Resolve dids to DIDDocs to retrieve services if (typeof service === 'string') { diff --git a/packages/core/src/agent/TransportService.ts b/packages/core/src/agent/TransportService.ts index 07a237d36d..402ff966de 100644 --- a/packages/core/src/agent/TransportService.ts +++ b/packages/core/src/agent/TransportService.ts @@ -1,4 +1,4 @@ -import type { AgentMessage } from './AgentMessage' +import type { AgentBaseMessage } from './AgentBaseMessage' import type { Key } from '../crypto' import type { EncryptedMessage } from '../didcomm' import type { DidDocument } from '../modules/dids' @@ -71,7 +71,7 @@ export interface TransportSession { keys?: SessionKeys // A received message that will be used to check whether it has any return routing. - inboundMessage?: AgentMessage + inboundMessage?: AgentBaseMessage // A stored connection id used to find this session via the `TransportService` for a specific connection connectionId?: string diff --git a/packages/core/src/agent/__tests__/stubs.ts b/packages/core/src/agent/__tests__/stubs.ts index 112ed1310d..d0d95abc79 100644 --- a/packages/core/src/agent/__tests__/stubs.ts +++ b/packages/core/src/agent/__tests__/stubs.ts @@ -1,11 +1,11 @@ -import type { AgentMessage } from '../AgentMessage' +import type { AgentBaseMessage } from '../AgentBaseMessage' import type { TransportSession, SessionKeys } from '../TransportService' export class DummyTransportSession implements TransportSession { public id: string public readonly type = 'http' public keys?: SessionKeys - public inboundMessage?: AgentMessage + public inboundMessage?: AgentBaseMessage public connectionId?: string public constructor(id: string) { diff --git a/packages/core/src/agent/models/InboundMessageContext.ts b/packages/core/src/agent/models/InboundMessageContext.ts index 8a6e800160..8dc3f0927b 100644 --- a/packages/core/src/agent/models/InboundMessageContext.ts +++ b/packages/core/src/agent/models/InboundMessageContext.ts @@ -1,6 +1,6 @@ import type { Key } from '../../crypto' import type { ConnectionRecord } from '../../modules/connections' -import type { AgentMessage } from '../AgentMessage' +import type { AgentBaseMessage } from '../AgentBaseMessage' import type { AgentContext } from '../context' import { AriesFrameworkError } from '../../error' @@ -13,7 +13,7 @@ export interface MessageContextParams { agentContext: AgentContext } -export class InboundMessageContext { +export class InboundMessageContext { public message: T public connection?: ConnectionRecord public sessionId?: string diff --git a/packages/core/src/agent/models/OutboundMessageContext.ts b/packages/core/src/agent/models/OutboundMessageContext.ts index f706b121ab..2cb7212d3e 100644 --- a/packages/core/src/agent/models/OutboundMessageContext.ts +++ b/packages/core/src/agent/models/OutboundMessageContext.ts @@ -6,7 +6,7 @@ import type { ResolvedDidCommService } from '../../modules/didcomm' import type { DidDocument } from '../../modules/dids/domain/DidDocument' import type { OutOfBandRecord } from '../../modules/oob' import type { BaseRecord } from '../../storage/BaseRecord' -import type { AgentMessage } from '../AgentMessage' +import type { AgentBaseMessage } from '../AgentBaseMessage' import type { AgentContext } from '../context' import { AriesFrameworkError } from '../../error' @@ -29,7 +29,7 @@ export interface OutboundMessageContextParams { senderDidDocument?: DidDocument } -export class OutboundMessageContext { +export class OutboundMessageContext { public message: T public connection?: ConnectionRecord public serviceParams?: ServiceMessageParams diff --git a/packages/core/src/decorators/attachment/v1/Attachment.ts b/packages/core/src/decorators/attachment/v1/Attachment.ts index 924245e57a..ac135b5b04 100644 --- a/packages/core/src/decorators/attachment/v1/Attachment.ts +++ b/packages/core/src/decorators/attachment/v1/Attachment.ts @@ -25,7 +25,7 @@ export interface AttachmentOptions { mimeType?: string lastmodTime?: Date byteCount?: number - data: AttachmentData + data: AttachmentDataOptions } export interface AttachmentDataOptions { @@ -97,7 +97,7 @@ export class Attachment { this.mimeType = options.mimeType this.lastmodTime = options.lastmodTime this.byteCount = options.byteCount - this.data = options.data + this.data = new AttachmentData(options.data) } } diff --git a/packages/core/src/decorators/thread/ThreadDecorator.ts b/packages/core/src/decorators/thread/ThreadDecorator.ts index 1724c7e0d7..933f34127b 100644 --- a/packages/core/src/decorators/thread/ThreadDecorator.ts +++ b/packages/core/src/decorators/thread/ThreadDecorator.ts @@ -24,7 +24,7 @@ export class ThreadDecorator { public threadId?: string /** - * An optional parent `threadId`. Used when branching or nesting a new interaction off of an existing one. + * An optional parent `thid`. Used when branching or nesting a new interaction off of an existing one. */ @Expose({ name: 'pthid' }) @Matches(MessageIdRegExp) diff --git a/packages/core/src/didcomm/versions/v1/DidCommV1Message.ts b/packages/core/src/didcomm/versions/v1/DidCommV1Message.ts index 6eaa19af48..43bd7ff5cc 100644 --- a/packages/core/src/didcomm/versions/v1/DidCommV1Message.ts +++ b/packages/core/src/didcomm/versions/v1/DidCommV1Message.ts @@ -1,4 +1,4 @@ -import type { AgentMessage } from '../../../agent/AgentMessage' +import type { AgentBaseMessage } from '../../../agent/AgentBaseMessage' import type { ServiceDecorator } from '../../../decorators/service/ServiceDecorator' import { Exclude } from 'class-transformer' @@ -22,7 +22,7 @@ const Decorated = ThreadDecorated( ) ) -export class DidCommV1Message extends Decorated implements AgentMessage { +export class DidCommV1Message extends Decorated implements AgentBaseMessage { /** * Whether the protocol RFC was initially written using the legacy did:prefix instead of the * new https://didcomm.org message type prefix. @@ -60,3 +60,6 @@ export class DidCommV1Message extends Decorated implements AgentMessage { return this.type === Class.type.messageTypeUri } } + +// type alias to keep backward compatibility +export class AgentMessage extends DidCommV1Message {} diff --git a/packages/core/src/didcomm/versions/v1/helpers.ts b/packages/core/src/didcomm/versions/v1/helpers.ts index 8750820154..6fd762ea5f 100644 --- a/packages/core/src/didcomm/versions/v1/helpers.ts +++ b/packages/core/src/didcomm/versions/v1/helpers.ts @@ -1,6 +1,6 @@ import type { DidCommV1Message } from './DidCommV1Message' import type { PlaintextDidCommV1Message } from './types' -import type { AgentMessage } from '../../../agent/AgentMessage' +import type { AgentBaseMessage } from '../../../agent/AgentBaseMessage' import type { EncryptedMessage, ProtectedMessage } from '../../types' import { AriesFrameworkError } from '../../../error' @@ -9,7 +9,7 @@ import { DidCommMessageVersion } from '../../types' import { DidCommV1Algorithms, DidCommV1Types } from './types' -export function isDidCommV1Message(message: AgentMessage): message is DidCommV1Message { +export function isDidCommV1Message(message: AgentBaseMessage): message is DidCommV1Message { return message.didCommVersion == DidCommMessageVersion.V1 } diff --git a/packages/core/src/didcomm/versions/v1/index.ts b/packages/core/src/didcomm/versions/v1/index.ts index a26c45be9d..a3c01e4074 100644 --- a/packages/core/src/didcomm/versions/v1/index.ts +++ b/packages/core/src/didcomm/versions/v1/index.ts @@ -1,6 +1,6 @@ import type { Key } from '../../../crypto' -export { DidCommV1Message } from './DidCommV1Message' +export { DidCommV1Message, AgentMessage } from './DidCommV1Message' export { DidCommV1BaseMessage, DidComV1BaseMessageConstructor } from './DidCommV1BaseMessage' export interface DidCommV1PackMessageParams { diff --git a/packages/core/src/didcomm/versions/v2/DidCommV2Message.ts b/packages/core/src/didcomm/versions/v2/DidCommV2Message.ts index e0a8d81ef9..7d6be06737 100644 --- a/packages/core/src/didcomm/versions/v2/DidCommV2Message.ts +++ b/packages/core/src/didcomm/versions/v2/DidCommV2Message.ts @@ -1,4 +1,4 @@ -import type { AgentMessage } from '../../../agent/AgentMessage' +import type { AgentBaseMessage } from '../../../agent/AgentBaseMessage' import type { ServiceDecorator } from '../../../decorators/service/ServiceDecorator' import { AriesFrameworkError } from '../../../error' @@ -7,7 +7,7 @@ import { DidCommMessageVersion } from '../../types' import { DidCommV2BaseMessage } from './DidCommV2BaseMessage' -export class DidCommV2Message extends DidCommV2BaseMessage implements AgentMessage { +export class DidCommV2Message extends DidCommV2BaseMessage implements AgentBaseMessage { public get didCommVersion(): DidCommMessageVersion { return DidCommMessageVersion.V2 } diff --git a/packages/core/src/didcomm/versions/v2/helpers.ts b/packages/core/src/didcomm/versions/v2/helpers.ts index 1ae3c3282e..737d85dfbe 100644 --- a/packages/core/src/didcomm/versions/v2/helpers.ts +++ b/packages/core/src/didcomm/versions/v2/helpers.ts @@ -1,10 +1,10 @@ import type { DidCommV2Message } from './DidCommV2Message' import type { PlaintextDidCommV2Message } from './types' -import type { AgentMessage } from '../../../agent/AgentMessage' +import type { AgentBaseMessage } from '../../../agent/AgentBaseMessage' import { DidCommMessageVersion } from '../../types' -export function isDidCommV2Message(message: AgentMessage): message is DidCommV2Message { +export function isDidCommV2Message(message: AgentBaseMessage): message is DidCommV2Message { return message.didCommVersion == DidCommMessageVersion.V2 } diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index 2d2313e00b..ae763b9f25 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -12,7 +12,7 @@ export { MessageHandler, MessageHandlerInboundMessage } from './agent/MessageHan export { MessageHandlerRegistry } from './agent/MessageHandlerRegistry' export * from './agent/models' export { AgentConfig } from './agent/AgentConfig' -export { AgentMessage } from './agent/AgentMessage' +export { AgentBaseMessage } from './agent/AgentBaseMessage' export { Dispatcher } from './agent/Dispatcher' export { MessageSender } from './agent/MessageSender' export type { AgentDependencies } from './agent/AgentDependencies' diff --git a/packages/core/src/modules/oob/OutOfBandApi.ts b/packages/core/src/modules/oob/OutOfBandApi.ts index eaf4f6835b..5f4ccf5ec0 100644 --- a/packages/core/src/modules/oob/OutOfBandApi.ts +++ b/packages/core/src/modules/oob/OutOfBandApi.ts @@ -376,7 +376,7 @@ export class OutOfBandApi { public async receiveInvitation( invitation: OutOfBandInvitation | ConnectionInvitationMessage | V2OutOfBandInvitation, config: ReceiveOutOfBandInvitationConfig = {} - ): Promise<{ outOfBandRecord?: OutOfBandRecord; connectionRecord?: ConnectionRecord }> { + ): Promise<{ outOfBandRecord: OutOfBandRecord; connectionRecord?: ConnectionRecord }> { return this._receiveInvitation(invitation, config) } @@ -414,7 +414,7 @@ export class OutOfBandApi { private async _receiveInvitation( invitation: OutOfBandInvitation | ConnectionInvitationMessage | V2OutOfBandInvitation, config: BaseReceiveOutOfBandInvitationConfig = {} - ): Promise<{ outOfBandRecord?: OutOfBandRecord; connectionRecord?: ConnectionRecord }> { + ): Promise<{ outOfBandRecord: OutOfBandRecord; connectionRecord?: ConnectionRecord }> { const { routing } = config const autoAcceptInvitation = config.autoAcceptInvitation ?? true @@ -546,7 +546,11 @@ export class OutOfBandApi { const outOfBandRecord = await this.outOfBandService.getById(this.agentContext, outOfBandId) if (outOfBandRecord.v2OutOfBandInvitation) { - return this.v2OutOfBandService.acceptInvitation(this.agentContext, outOfBandRecord.v2OutOfBandInvitation) + const { connectionRecord } = await this.v2OutOfBandService.acceptInvitation( + this.agentContext, + outOfBandRecord.v2OutOfBandInvitation + ) + return { outOfBandRecord, connectionRecord } } const timeoutMs = config.timeoutMs ?? 20000 diff --git a/packages/core/src/storage/didcomm/DidCommMessageRepository.ts b/packages/core/src/storage/didcomm/DidCommMessageRepository.ts index bea56cfda8..9427bcf9d2 100644 --- a/packages/core/src/storage/didcomm/DidCommMessageRepository.ts +++ b/packages/core/src/storage/didcomm/DidCommMessageRepository.ts @@ -1,6 +1,6 @@ import type { DidCommMessageRole } from './DidCommMessageRole' import type { AgentContext } from '../../agent' -import type { AgentMessage } from '../../agent/AgentMessage' +import type { AgentBaseMessage } from '../../agent/AgentBaseMessage' import type { ConstructableDidCommMessage } from '../../didcomm' import type { JsonObject } from '../../types' @@ -85,7 +85,7 @@ export class DidCommMessageRepository extends Repository { export interface SaveAgentMessageOptions { role: DidCommMessageRole - agentMessage: AgentMessage + agentMessage: AgentBaseMessage associatedRecordId: string } diff --git a/packages/core/tests/connections.test.ts b/packages/core/tests/connections.test.ts index 9284b90be2..4f2498ce90 100644 --- a/packages/core/tests/connections.test.ts +++ b/packages/core/tests/connections.test.ts @@ -110,7 +110,7 @@ describe('connections', () => { multiUseInvitation: true, }) - const invitation = faberOutOfBandRecord.outOfBandInvitation! + const invitation = faberOutOfBandRecord.getOutOfBandInvitation() const invitationUrl = invitation.toUrl({ domain: 'https://example.com' }) // Receive invitation first time with alice agent diff --git a/samples/extension-module/README.md b/samples/extension-module/README.md index 98abe413ab..309d5cb0ef 100644 --- a/samples/extension-module/README.md +++ b/samples/extension-module/README.md @@ -51,7 +51,7 @@ agent.events.on(DummyEventTypes.StateChanged, async (event: DummyStateChangedEve } }) -const { outOfBandRecord } = await agent.modules.dummy.request(connection) +const record = await agent.modules.dummy.request(connection) ``` ## Run demo diff --git a/samples/extension-module/dummy/messages/DummyRequestMessage.ts b/samples/extension-module/dummy/messages/DummyRequestMessage.ts index 4e15cfde0f..5ca16f25dd 100644 --- a/samples/extension-module/dummy/messages/DummyRequestMessage.ts +++ b/samples/extension-module/dummy/messages/DummyRequestMessage.ts @@ -1,10 +1,10 @@ -import { DidCommV1Message, IsValidMessageType, parseMessageType, ReturnRouteTypes } from '@aries-framework/core' +import { AgentMessage, IsValidMessageType, parseMessageType, ReturnRouteTypes } from '@aries-framework/core' export interface DummyRequestMessageOptions { id?: string } -export class DummyRequestMessage extends DidCommV1Message { +export class DummyRequestMessage extends AgentMessage { public constructor(options: DummyRequestMessageOptions) { super() diff --git a/samples/extension-module/dummy/messages/DummyResponseMessage.ts b/samples/extension-module/dummy/messages/DummyResponseMessage.ts index 45f1b0cb99..560183d95c 100644 --- a/samples/extension-module/dummy/messages/DummyResponseMessage.ts +++ b/samples/extension-module/dummy/messages/DummyResponseMessage.ts @@ -1,11 +1,11 @@ -import { DidCommV1Message, IsValidMessageType, parseMessageType } from '@aries-framework/core' +import { AgentMessage, IsValidMessageType, parseMessageType } from '@aries-framework/core' export interface DummyResponseMessageOptions { id?: string threadId: string } -export class DummyResponseMessage extends DidCommV1Message { +export class DummyResponseMessage extends AgentMessage { public constructor(options: DummyResponseMessageOptions) { super()