@credo-ts/didcomm 0.6.0-pr-2392-20251010173905 → 0.6.0-pr-2457-20251016083534
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/BaseDidCommMessage.d.mts.map +1 -1
- package/build/BaseDidCommMessage.d.ts.map +1 -1
- package/build/BaseDidCommMessage.js +3 -3
- package/build/BaseDidCommMessage.mjs +2 -2
- package/build/BaseDidCommMessage.mjs.map +1 -1
- package/build/DidCommApi.d.mts +6 -10
- package/build/DidCommApi.d.mts.map +1 -1
- package/build/DidCommApi.d.ts +6 -10
- package/build/DidCommApi.d.ts.map +1 -1
- package/build/DidCommApi.js +16 -21
- package/build/DidCommApi.mjs +16 -21
- package/build/DidCommApi.mjs.map +1 -1
- package/build/DidCommDispatcher.d.mts.map +1 -1
- package/build/DidCommDispatcher.d.ts.map +1 -1
- package/build/DidCommDispatcher.js +7 -7
- package/build/DidCommDispatcher.mjs +7 -7
- package/build/DidCommDispatcher.mjs.map +1 -1
- package/build/DidCommEnvelopeService.d.mts.map +1 -1
- package/build/DidCommEnvelopeService.d.ts.map +1 -1
- package/build/DidCommEnvelopeService.js +5 -5
- package/build/DidCommEnvelopeService.mjs +5 -5
- package/build/DidCommEnvelopeService.mjs.map +1 -1
- package/build/DidCommFeatureRegistry.d.mts.map +1 -1
- package/build/DidCommFeatureRegistry.d.ts.map +1 -1
- package/build/DidCommFeatureRegistry.mjs.map +1 -1
- package/build/DidCommMessage.d.mts +1 -1
- package/build/DidCommMessage.d.mts.map +1 -1
- package/build/DidCommMessage.d.ts +1 -1
- package/build/DidCommMessage.d.ts.map +1 -1
- package/build/DidCommMessage.js +2 -2
- package/build/DidCommMessage.mjs +2 -2
- package/build/DidCommMessage.mjs.map +1 -1
- package/build/DidCommMessageHandlerRegistry.d.mts.map +1 -1
- package/build/DidCommMessageHandlerRegistry.d.ts.map +1 -1
- package/build/DidCommMessageHandlerRegistry.mjs.map +1 -1
- package/build/DidCommMessageReceiver.d.mts +1 -6
- package/build/DidCommMessageReceiver.d.mts.map +1 -1
- package/build/DidCommMessageReceiver.d.ts +1 -6
- package/build/DidCommMessageReceiver.d.ts.map +1 -1
- package/build/DidCommMessageReceiver.js +9 -21
- package/build/DidCommMessageReceiver.mjs +9 -21
- package/build/DidCommMessageReceiver.mjs.map +1 -1
- package/build/DidCommMessageSender.d.mts +1 -6
- package/build/DidCommMessageSender.d.mts.map +1 -1
- package/build/DidCommMessageSender.d.ts +1 -6
- package/build/DidCommMessageSender.d.ts.map +1 -1
- package/build/DidCommMessageSender.js +17 -29
- package/build/DidCommMessageSender.mjs +17 -29
- package/build/DidCommMessageSender.mjs.map +1 -1
- package/build/DidCommModule.d.mts +1 -1
- package/build/DidCommModule.d.mts.map +1 -1
- package/build/DidCommModule.d.ts +1 -1
- package/build/DidCommModule.d.ts.map +1 -1
- package/build/DidCommModule.js +9 -12
- package/build/DidCommModule.mjs +9 -12
- package/build/DidCommModule.mjs.map +1 -1
- package/build/DidCommModuleConfig.d.mts +14 -2
- package/build/DidCommModuleConfig.d.mts.map +1 -1
- package/build/DidCommModuleConfig.d.ts +14 -2
- package/build/DidCommModuleConfig.d.ts.map +1 -1
- package/build/DidCommModuleConfig.js +15 -1
- package/build/DidCommModuleConfig.mjs +15 -1
- package/build/DidCommModuleConfig.mjs.map +1 -1
- package/build/DidCommTransportService.d.mts.map +1 -1
- package/build/DidCommTransportService.d.ts.map +1 -1
- package/build/DidCommTransportService.js +1 -1
- package/build/DidCommTransportService.mjs +1 -1
- package/build/DidCommTransportService.mjs.map +1 -1
- package/build/decorators/ack/AckDecorator.js +1 -1
- package/build/decorators/ack/AckDecorator.mjs +1 -1
- package/build/decorators/ack/AckDecoratorExtension.js +3 -3
- package/build/decorators/ack/AckDecoratorExtension.mjs +2 -2
- package/build/decorators/ack/AckDecoratorExtension.mjs.map +1 -1
- package/build/decorators/attachment/AttachmentExtension.js +3 -3
- package/build/decorators/attachment/AttachmentExtension.mjs +2 -2
- package/build/decorators/attachment/AttachmentExtension.mjs.map +1 -1
- package/build/decorators/attachment/DidCommAttachment.js +3 -3
- package/build/decorators/attachment/DidCommAttachment.mjs +2 -2
- package/build/decorators/attachment/DidCommAttachment.mjs.map +1 -1
- package/build/decorators/l10n/L10nDecoratorExtension.js +3 -3
- package/build/decorators/l10n/L10nDecoratorExtension.mjs +2 -2
- package/build/decorators/l10n/L10nDecoratorExtension.mjs.map +1 -1
- package/build/decorators/service/ServiceDecorator.js +1 -1
- package/build/decorators/service/ServiceDecorator.mjs +1 -1
- package/build/decorators/service/ServiceDecoratorExtension.js +3 -3
- package/build/decorators/service/ServiceDecoratorExtension.mjs +2 -2
- package/build/decorators/service/ServiceDecoratorExtension.mjs.map +1 -1
- package/build/decorators/signature/SignatureDecorator.js +4 -4
- package/build/decorators/signature/SignatureDecorator.mjs +3 -3
- package/build/decorators/thread/ThreadDecorator.js +3 -3
- package/build/decorators/thread/ThreadDecorator.mjs +2 -2
- package/build/decorators/thread/ThreadDecoratorExtension.js +3 -3
- package/build/decorators/thread/ThreadDecoratorExtension.mjs +2 -2
- package/build/decorators/thread/ThreadDecoratorExtension.mjs.map +1 -1
- package/build/decorators/timing/TimingDecorator.js +3 -3
- package/build/decorators/timing/TimingDecorator.mjs +2 -2
- package/build/decorators/timing/TimingDecoratorExtension.js +3 -3
- package/build/decorators/timing/TimingDecoratorExtension.mjs +2 -2
- package/build/decorators/timing/TimingDecoratorExtension.mjs.map +1 -1
- package/build/decorators/transport/TransportDecorator.js +3 -3
- package/build/decorators/transport/TransportDecorator.mjs +2 -2
- package/build/decorators/transport/TransportDecoratorExtension.js +3 -3
- package/build/decorators/transport/TransportDecoratorExtension.mjs +2 -2
- package/build/decorators/transport/TransportDecoratorExtension.mjs.map +1 -1
- package/build/errors/MessageSendingError.d.mts.map +1 -1
- package/build/errors/MessageSendingError.d.ts.map +1 -1
- package/build/errors/MessageSendingError.mjs.map +1 -1
- package/build/errors/index.js +1 -1
- package/build/errors/index.mjs +1 -1
- package/build/getDidCommOutboundMessageContext.d.mts.map +1 -1
- package/build/getDidCommOutboundMessageContext.d.ts.map +1 -1
- package/build/getDidCommOutboundMessageContext.js +6 -6
- package/build/getDidCommOutboundMessageContext.mjs +6 -6
- package/build/getDidCommOutboundMessageContext.mjs.map +1 -1
- package/build/handlers/DidCommMessageHandlerMiddleware.mjs.map +1 -1
- package/build/index.d.mts +99 -99
- package/build/index.d.ts +99 -99
- package/build/index.js +114 -112
- package/build/index.mjs +108 -108
- package/build/messages/common/DidCommAckMessage.js +1 -1
- package/build/messages/common/DidCommAckMessage.mjs +1 -1
- package/build/messages/problem-reports/DidCommProblemReportMessage.js +3 -3
- package/build/messages/problem-reports/DidCommProblemReportMessage.mjs +2 -2
- package/build/models/DidCommInboundMessageContext.d.mts.map +1 -1
- package/build/models/DidCommInboundMessageContext.d.ts.map +1 -1
- package/build/models/DidCommInboundMessageContext.mjs.map +1 -1
- package/build/models/DidCommOutboundMessageContext.d.mts.map +1 -1
- package/build/models/DidCommOutboundMessageContext.d.ts.map +1 -1
- package/build/models/DidCommOutboundMessageContext.mjs.map +1 -1
- package/build/models/features/DidCommFeature.js +3 -3
- package/build/models/features/DidCommFeature.mjs +2 -2
- package/build/models/features/DidCommFeatureQuery.js +3 -3
- package/build/models/features/DidCommFeatureQuery.mjs +2 -2
- package/build/models/features/DidCommProtocol.d.mts.map +1 -1
- package/build/models/features/DidCommProtocol.d.ts.map +1 -1
- package/build/models/features/DidCommProtocol.js +1 -1
- package/build/models/features/DidCommProtocol.mjs +1 -1
- package/build/models/features/DidCommProtocol.mjs.map +1 -1
- package/build/models/index.js +3 -3
- package/build/models/index.mjs +3 -3
- package/build/modules/basic-messages/DidCommBasicMessagesApi.d.mts +1 -1
- package/build/modules/basic-messages/DidCommBasicMessagesApi.d.mts.map +1 -1
- package/build/modules/basic-messages/DidCommBasicMessagesApi.d.ts +1 -1
- package/build/modules/basic-messages/DidCommBasicMessagesApi.d.ts.map +1 -1
- package/build/modules/basic-messages/DidCommBasicMessagesApi.js +2 -2
- package/build/modules/basic-messages/DidCommBasicMessagesApi.mjs +2 -2
- package/build/modules/basic-messages/DidCommBasicMessagesApi.mjs.map +1 -1
- package/build/modules/basic-messages/DidCommBasicMessagesModule.d.mts.map +1 -1
- package/build/modules/basic-messages/DidCommBasicMessagesModule.d.ts.map +1 -1
- package/build/modules/basic-messages/DidCommBasicMessagesModule.js +2 -2
- package/build/modules/basic-messages/DidCommBasicMessagesModule.mjs +2 -2
- package/build/modules/basic-messages/DidCommBasicMessagesModule.mjs.map +1 -1
- package/build/modules/basic-messages/handlers/BasicMessageHandler.mjs.map +1 -1
- package/build/modules/basic-messages/index.js +2 -2
- package/build/modules/basic-messages/index.mjs +2 -2
- package/build/modules/basic-messages/messages/DidCommBasicMessage.js +3 -3
- package/build/modules/basic-messages/messages/DidCommBasicMessage.mjs +2 -2
- package/build/modules/basic-messages/repository/DidCommBasicMessageRecord.d.mts.map +1 -1
- package/build/modules/basic-messages/repository/DidCommBasicMessageRecord.d.ts.map +1 -1
- package/build/modules/basic-messages/repository/DidCommBasicMessageRecord.mjs.map +1 -1
- package/build/modules/basic-messages/repository/DidCommBasicMessageRepository.js +1 -1
- package/build/modules/basic-messages/repository/DidCommBasicMessageRepository.mjs +1 -1
- package/build/modules/basic-messages/repository/DidCommBasicMessageRepository.mjs.map +1 -1
- package/build/modules/basic-messages/services/DidCommBasicMessageService.d.mts.map +1 -1
- package/build/modules/basic-messages/services/DidCommBasicMessageService.d.ts.map +1 -1
- package/build/modules/basic-messages/services/DidCommBasicMessageService.js +4 -4
- package/build/modules/basic-messages/services/DidCommBasicMessageService.mjs +4 -4
- package/build/modules/basic-messages/services/DidCommBasicMessageService.mjs.map +1 -1
- package/build/modules/connections/DidCommConnectionsApi.d.mts +3 -3
- package/build/modules/connections/DidCommConnectionsApi.d.mts.map +1 -1
- package/build/modules/connections/DidCommConnectionsApi.d.ts +3 -3
- package/build/modules/connections/DidCommConnectionsApi.d.ts.map +1 -1
- package/build/modules/connections/DidCommConnectionsApi.js +5 -5
- package/build/modules/connections/DidCommConnectionsApi.mjs +5 -5
- package/build/modules/connections/DidCommConnectionsApi.mjs.map +1 -1
- package/build/modules/connections/DidCommConnectionsModule.d.mts.map +1 -1
- package/build/modules/connections/DidCommConnectionsModule.d.ts.map +1 -1
- package/build/modules/connections/DidCommConnectionsModule.js +20 -20
- package/build/modules/connections/DidCommConnectionsModule.mjs +20 -20
- package/build/modules/connections/DidCommConnectionsModule.mjs.map +1 -1
- package/build/modules/connections/DidExchangeProtocol.d.mts +2 -4
- package/build/modules/connections/DidExchangeProtocol.d.mts.map +1 -1
- package/build/modules/connections/DidExchangeProtocol.d.ts +2 -4
- package/build/modules/connections/DidExchangeProtocol.d.ts.map +1 -1
- package/build/modules/connections/DidExchangeProtocol.js +11 -15
- package/build/modules/connections/DidExchangeProtocol.mjs +11 -15
- package/build/modules/connections/DidExchangeProtocol.mjs.map +1 -1
- package/build/modules/connections/DidExchangeStateMachine.js +1 -1
- package/build/modules/connections/DidExchangeStateMachine.mjs +1 -1
- package/build/modules/connections/DidExchangeStateMachine.mjs.map +1 -1
- package/build/modules/connections/errors/ConnectionProblemReportError.d.mts +1 -1
- package/build/modules/connections/errors/ConnectionProblemReportError.d.mts.map +1 -1
- package/build/modules/connections/errors/ConnectionProblemReportError.d.ts +1 -1
- package/build/modules/connections/errors/ConnectionProblemReportError.d.ts.map +1 -1
- package/build/modules/connections/errors/ConnectionProblemReportError.mjs.map +1 -1
- package/build/modules/connections/errors/DidExchangeProblemReportError.d.mts +1 -1
- package/build/modules/connections/errors/DidExchangeProblemReportError.d.mts.map +1 -1
- package/build/modules/connections/errors/DidExchangeProblemReportError.d.ts +1 -1
- package/build/modules/connections/errors/DidExchangeProblemReportError.d.ts.map +1 -1
- package/build/modules/connections/errors/DidExchangeProblemReportError.mjs.map +1 -1
- package/build/modules/connections/handlers/DidCommAckMessageHandler.d.mts.map +1 -1
- package/build/modules/connections/handlers/DidCommAckMessageHandler.d.ts.map +1 -1
- package/build/modules/connections/handlers/DidCommAckMessageHandler.mjs.map +1 -1
- package/build/modules/connections/handlers/DidCommConnectionProblemReportHandler.d.mts.map +1 -1
- package/build/modules/connections/handlers/DidCommConnectionProblemReportHandler.d.ts.map +1 -1
- package/build/modules/connections/handlers/DidCommConnectionProblemReportHandler.mjs.map +1 -1
- package/build/modules/connections/handlers/DidCommConnectionRequestHandler.d.mts +1 -1
- package/build/modules/connections/handlers/DidCommConnectionRequestHandler.d.mts.map +1 -1
- package/build/modules/connections/handlers/DidCommConnectionRequestHandler.d.ts +1 -1
- package/build/modules/connections/handlers/DidCommConnectionRequestHandler.d.ts.map +1 -1
- package/build/modules/connections/handlers/DidCommConnectionRequestHandler.js +4 -4
- package/build/modules/connections/handlers/DidCommConnectionRequestHandler.mjs +4 -4
- package/build/modules/connections/handlers/DidCommConnectionRequestHandler.mjs.map +1 -1
- package/build/modules/connections/handlers/DidCommConnectionResponseHandler.d.mts.map +1 -1
- package/build/modules/connections/handlers/DidCommConnectionResponseHandler.d.ts.map +1 -1
- package/build/modules/connections/handlers/DidCommConnectionResponseHandler.js +3 -3
- package/build/modules/connections/handlers/DidCommConnectionResponseHandler.mjs +3 -3
- package/build/modules/connections/handlers/DidCommConnectionResponseHandler.mjs.map +1 -1
- package/build/modules/connections/handlers/DidCommDidExchangeCompleteHandler.d.mts.map +1 -1
- package/build/modules/connections/handlers/DidCommDidExchangeCompleteHandler.d.ts.map +1 -1
- package/build/modules/connections/handlers/DidCommDidExchangeCompleteHandler.mjs.map +1 -1
- package/build/modules/connections/handlers/DidCommDidExchangeRequestHandler.d.mts +1 -1
- package/build/modules/connections/handlers/DidCommDidExchangeRequestHandler.d.mts.map +1 -1
- package/build/modules/connections/handlers/DidCommDidExchangeRequestHandler.d.ts +1 -1
- package/build/modules/connections/handlers/DidCommDidExchangeRequestHandler.d.ts.map +1 -1
- package/build/modules/connections/handlers/DidCommDidExchangeRequestHandler.js +4 -4
- package/build/modules/connections/handlers/DidCommDidExchangeRequestHandler.mjs +4 -4
- package/build/modules/connections/handlers/DidCommDidExchangeRequestHandler.mjs.map +1 -1
- package/build/modules/connections/handlers/DidCommDidExchangeResponseHandler.d.mts +1 -1
- package/build/modules/connections/handlers/DidCommDidExchangeResponseHandler.d.mts.map +1 -1
- package/build/modules/connections/handlers/DidCommDidExchangeResponseHandler.d.ts +1 -1
- package/build/modules/connections/handlers/DidCommDidExchangeResponseHandler.d.ts.map +1 -1
- package/build/modules/connections/handlers/DidCommDidExchangeResponseHandler.js +4 -4
- package/build/modules/connections/handlers/DidCommDidExchangeResponseHandler.mjs +4 -4
- package/build/modules/connections/handlers/DidCommDidExchangeResponseHandler.mjs.map +1 -1
- package/build/modules/connections/handlers/DidCommDidRotateAckHandler.d.mts.map +1 -1
- package/build/modules/connections/handlers/DidCommDidRotateAckHandler.d.ts.map +1 -1
- package/build/modules/connections/handlers/DidCommDidRotateAckHandler.mjs.map +1 -1
- package/build/modules/connections/handlers/DidCommDidRotateHandler.d.mts +3 -5
- package/build/modules/connections/handlers/DidCommDidRotateHandler.d.mts.map +1 -1
- package/build/modules/connections/handlers/DidCommDidRotateHandler.d.ts +3 -5
- package/build/modules/connections/handlers/DidCommDidRotateHandler.d.ts.map +1 -1
- package/build/modules/connections/handlers/DidCommDidRotateHandler.js +1 -2
- package/build/modules/connections/handlers/DidCommDidRotateHandler.mjs +1 -2
- package/build/modules/connections/handlers/DidCommDidRotateHandler.mjs.map +1 -1
- package/build/modules/connections/handlers/DidCommDidRotateProblemReportHandler.d.mts.map +1 -1
- package/build/modules/connections/handlers/DidCommDidRotateProblemReportHandler.d.ts.map +1 -1
- package/build/modules/connections/handlers/DidCommDidRotateProblemReportHandler.mjs.map +1 -1
- package/build/modules/connections/handlers/DidCommHangupHandler.d.mts.map +1 -1
- package/build/modules/connections/handlers/DidCommHangupHandler.d.ts.map +1 -1
- package/build/modules/connections/handlers/DidCommHangupHandler.mjs.map +1 -1
- package/build/modules/connections/handlers/DidCommTrustPingMessageHandler.d.mts.map +1 -1
- package/build/modules/connections/handlers/DidCommTrustPingMessageHandler.d.ts.map +1 -1
- package/build/modules/connections/handlers/DidCommTrustPingMessageHandler.mjs.map +1 -1
- package/build/modules/connections/handlers/DidCommTrustPingResponseMessageHandler.d.mts.map +1 -1
- package/build/modules/connections/handlers/DidCommTrustPingResponseMessageHandler.d.ts.map +1 -1
- package/build/modules/connections/handlers/DidCommTrustPingResponseMessageHandler.mjs.map +1 -1
- package/build/modules/connections/handlers/index.js +5 -5
- package/build/modules/connections/handlers/index.mjs +5 -5
- package/build/modules/connections/index.js +23 -23
- package/build/modules/connections/index.mjs +23 -23
- package/build/modules/connections/messages/DidCommConnectionInvitationMessage.d.mts.map +1 -1
- package/build/modules/connections/messages/DidCommConnectionInvitationMessage.d.ts.map +1 -1
- package/build/modules/connections/messages/DidCommConnectionInvitationMessage.js +4 -4
- package/build/modules/connections/messages/DidCommConnectionInvitationMessage.mjs +4 -4
- package/build/modules/connections/messages/DidCommConnectionInvitationMessage.mjs.map +1 -1
- package/build/modules/connections/messages/DidCommConnectionProblemReportMessage.js +1 -1
- package/build/modules/connections/messages/DidCommConnectionProblemReportMessage.mjs +1 -1
- package/build/modules/connections/messages/DidCommConnectionRequestMessage.d.mts.map +1 -1
- package/build/modules/connections/messages/DidCommConnectionRequestMessage.d.ts.map +1 -1
- package/build/modules/connections/messages/DidCommConnectionRequestMessage.js +4 -4
- package/build/modules/connections/messages/DidCommConnectionRequestMessage.mjs +3 -3
- package/build/modules/connections/messages/DidCommConnectionRequestMessage.mjs.map +1 -1
- package/build/modules/connections/messages/DidCommConnectionResponseMessage.js +3 -3
- package/build/modules/connections/messages/DidCommConnectionResponseMessage.mjs +2 -2
- package/build/modules/connections/messages/DidCommDidExchangeCompleteMessage.js +1 -1
- package/build/modules/connections/messages/DidCommDidExchangeCompleteMessage.mjs +1 -1
- package/build/modules/connections/messages/DidCommDidExchangeProblemReportMessage.js +1 -1
- package/build/modules/connections/messages/DidCommDidExchangeProblemReportMessage.mjs +1 -1
- package/build/modules/connections/messages/DidCommDidExchangeRequestMessage.js +4 -4
- package/build/modules/connections/messages/DidCommDidExchangeRequestMessage.mjs +3 -3
- package/build/modules/connections/messages/DidCommDidExchangeResponseMessage.js +4 -4
- package/build/modules/connections/messages/DidCommDidExchangeResponseMessage.mjs +3 -3
- package/build/modules/connections/messages/DidCommDidRotateAckMessage.js +1 -1
- package/build/modules/connections/messages/DidCommDidRotateAckMessage.mjs +1 -1
- package/build/modules/connections/messages/DidCommDidRotateMessage.js +3 -3
- package/build/modules/connections/messages/DidCommDidRotateMessage.mjs +2 -2
- package/build/modules/connections/messages/DidCommDidRotateProblemReportMessage.js +1 -1
- package/build/modules/connections/messages/DidCommDidRotateProblemReportMessage.mjs +1 -1
- package/build/modules/connections/messages/DidCommHangupMessage.js +1 -1
- package/build/modules/connections/messages/DidCommHangupMessage.mjs +1 -1
- package/build/modules/connections/messages/DidCommTrustPingMessage.d.mts.map +1 -1
- package/build/modules/connections/messages/DidCommTrustPingMessage.d.ts.map +1 -1
- package/build/modules/connections/messages/DidCommTrustPingMessage.js +3 -3
- package/build/modules/connections/messages/DidCommTrustPingMessage.mjs +2 -2
- package/build/modules/connections/messages/DidCommTrustPingMessage.mjs.map +1 -1
- package/build/modules/connections/messages/DidCommTrustPingResponseMessage.d.mts.map +1 -1
- package/build/modules/connections/messages/DidCommTrustPingResponseMessage.d.ts.map +1 -1
- package/build/modules/connections/messages/DidCommTrustPingResponseMessage.js +1 -1
- package/build/modules/connections/messages/DidCommTrustPingResponseMessage.mjs +1 -1
- package/build/modules/connections/messages/DidCommTrustPingResponseMessage.mjs.map +1 -1
- package/build/modules/connections/messages/index.js +7 -7
- package/build/modules/connections/messages/index.mjs +7 -7
- package/build/modules/connections/models/DidCommConnection.js +3 -3
- package/build/modules/connections/models/DidCommConnection.mjs +2 -2
- package/build/modules/connections/models/did/DidDoc.d.mts.map +1 -1
- package/build/modules/connections/models/did/DidDoc.d.ts.map +1 -1
- package/build/modules/connections/models/did/DidDoc.js +3 -3
- package/build/modules/connections/models/did/DidDoc.mjs +2 -2
- package/build/modules/connections/models/did/DidDoc.mjs.map +1 -1
- package/build/modules/connections/models/did/authentication/EmbeddedAuthentication.js +1 -1
- package/build/modules/connections/models/did/authentication/EmbeddedAuthentication.mjs +1 -1
- package/build/modules/connections/models/did/authentication/ReferencedAuthentication.js +3 -3
- package/build/modules/connections/models/did/authentication/ReferencedAuthentication.mjs +2 -2
- package/build/modules/connections/models/did/authentication/index.d.mts.map +1 -1
- package/build/modules/connections/models/did/authentication/index.d.ts.map +1 -1
- package/build/modules/connections/models/did/authentication/index.mjs.map +1 -1
- package/build/modules/connections/models/did/publicKey/Ed25119Sig2018.js +3 -3
- package/build/modules/connections/models/did/publicKey/Ed25119Sig2018.mjs +2 -2
- package/build/modules/connections/models/did/publicKey/EddsaSaSigSecp256k1.js +3 -3
- package/build/modules/connections/models/did/publicKey/EddsaSaSigSecp256k1.mjs +2 -2
- package/build/modules/connections/models/did/publicKey/PublicKey.js +1 -1
- package/build/modules/connections/models/did/publicKey/PublicKey.mjs +1 -1
- package/build/modules/connections/models/did/publicKey/RsaSig2018.js +3 -3
- package/build/modules/connections/models/did/publicKey/RsaSig2018.mjs +2 -2
- package/build/modules/connections/models/did/publicKey/index.mjs.map +1 -1
- package/build/modules/connections/models/index.js +1 -1
- package/build/modules/connections/models/index.mjs +1 -1
- package/build/modules/connections/repository/DidCommConnectionRecord.d.mts +1 -1
- package/build/modules/connections/repository/DidCommConnectionRecord.d.mts.map +1 -1
- package/build/modules/connections/repository/DidCommConnectionRecord.d.ts +1 -1
- package/build/modules/connections/repository/DidCommConnectionRecord.d.ts.map +1 -1
- package/build/modules/connections/repository/DidCommConnectionRecord.js +1 -1
- package/build/modules/connections/repository/DidCommConnectionRecord.mjs +1 -1
- package/build/modules/connections/repository/DidCommConnectionRecord.mjs.map +1 -1
- package/build/modules/connections/repository/DidCommConnectionRepository.js +2 -2
- package/build/modules/connections/repository/DidCommConnectionRepository.mjs +2 -2
- package/build/modules/connections/repository/DidCommConnectionRepository.mjs.map +1 -1
- package/build/modules/connections/services/DidCommConnectionService.d.mts +3 -3
- package/build/modules/connections/services/DidCommConnectionService.d.mts.map +1 -1
- package/build/modules/connections/services/DidCommConnectionService.d.ts +3 -3
- package/build/modules/connections/services/DidCommConnectionService.d.ts.map +1 -1
- package/build/modules/connections/services/DidCommConnectionService.js +13 -13
- package/build/modules/connections/services/DidCommConnectionService.mjs +13 -13
- package/build/modules/connections/services/DidCommConnectionService.mjs.map +1 -1
- package/build/modules/connections/services/DidCommDidRotateService.d.mts +2 -2
- package/build/modules/connections/services/DidCommDidRotateService.d.mts.map +1 -1
- package/build/modules/connections/services/DidCommDidRotateService.d.ts +2 -2
- package/build/modules/connections/services/DidCommDidRotateService.d.ts.map +1 -1
- package/build/modules/connections/services/DidCommDidRotateService.js +8 -8
- package/build/modules/connections/services/DidCommDidRotateService.mjs +8 -8
- package/build/modules/connections/services/DidCommDidRotateService.mjs.map +1 -1
- package/build/modules/connections/services/DidCommTrustPingService.d.mts.map +1 -1
- package/build/modules/connections/services/DidCommTrustPingService.d.ts.map +1 -1
- package/build/modules/connections/services/DidCommTrustPingService.js +1 -1
- package/build/modules/connections/services/DidCommTrustPingService.mjs +1 -1
- package/build/modules/connections/services/DidCommTrustPingService.mjs.map +1 -1
- package/build/modules/connections/services/helpers.js +1 -1
- package/build/modules/connections/services/helpers.mjs +1 -1
- package/build/modules/connections/services/helpers.mjs.map +1 -1
- package/build/modules/credentials/DidCommCredentialsApi.d.mts.map +1 -1
- package/build/modules/credentials/DidCommCredentialsApi.d.ts.map +1 -1
- package/build/modules/credentials/DidCommCredentialsApi.js +2 -2
- package/build/modules/credentials/DidCommCredentialsApi.mjs +2 -2
- package/build/modules/credentials/DidCommCredentialsApi.mjs.map +1 -1
- package/build/modules/credentials/DidCommCredentialsModule.d.mts.map +1 -1
- package/build/modules/credentials/DidCommCredentialsModule.d.ts.map +1 -1
- package/build/modules/credentials/DidCommCredentialsModule.js +2 -2
- package/build/modules/credentials/DidCommCredentialsModule.mjs +2 -2
- package/build/modules/credentials/DidCommCredentialsModule.mjs.map +1 -1
- package/build/modules/credentials/DidCommCredentialsModuleConfig.d.mts.map +1 -1
- package/build/modules/credentials/DidCommCredentialsModuleConfig.d.ts.map +1 -1
- package/build/modules/credentials/DidCommCredentialsModuleConfig.mjs.map +1 -1
- package/build/modules/credentials/formats/DidCommCredentialFormatServiceOptions.d.mts +1 -1
- package/build/modules/credentials/formats/DidCommCredentialFormatServiceOptions.d.ts +1 -1
- package/build/modules/credentials/formats/dataIntegrity/dataIntegrityExchange.js +3 -3
- package/build/modules/credentials/formats/dataIntegrity/dataIntegrityExchange.mjs +2 -2
- package/build/modules/credentials/formats/index.js +2 -2
- package/build/modules/credentials/formats/index.mjs +2 -2
- package/build/modules/credentials/formats/jsonld/DidCommJsonLdCredentialDetail.js +1 -1
- package/build/modules/credentials/formats/jsonld/DidCommJsonLdCredentialDetail.mjs +1 -1
- package/build/modules/credentials/formats/jsonld/DidCommJsonLdCredentialDetailOptions.js +1 -1
- package/build/modules/credentials/formats/jsonld/DidCommJsonLdCredentialDetailOptions.mjs +1 -1
- package/build/modules/credentials/formats/jsonld/DidCommJsonLdCredentialFormatService.d.mts.map +1 -1
- package/build/modules/credentials/formats/jsonld/DidCommJsonLdCredentialFormatService.d.ts.map +1 -1
- package/build/modules/credentials/formats/jsonld/DidCommJsonLdCredentialFormatService.mjs.map +1 -1
- package/build/modules/credentials/index.js +5 -5
- package/build/modules/credentials/index.mjs +5 -5
- package/build/modules/credentials/models/DidCommCredentialFormatSpec.js +3 -3
- package/build/modules/credentials/models/DidCommCredentialFormatSpec.mjs +2 -2
- package/build/modules/credentials/models/DidCommCredentialPreviewAttribute.js +3 -3
- package/build/modules/credentials/models/DidCommCredentialPreviewAttribute.mjs +2 -2
- package/build/modules/credentials/models/DidCommRevocationNotification.js +1 -1
- package/build/modules/credentials/models/DidCommRevocationNotification.mjs +1 -1
- package/build/modules/credentials/models/index.js +3 -3
- package/build/modules/credentials/models/index.mjs +3 -3
- package/build/modules/credentials/protocol/DidCommBaseCredentialProtocol.d.mts +1 -1
- package/build/modules/credentials/protocol/DidCommBaseCredentialProtocol.d.mts.map +1 -1
- package/build/modules/credentials/protocol/DidCommBaseCredentialProtocol.d.ts +1 -1
- package/build/modules/credentials/protocol/DidCommBaseCredentialProtocol.d.ts.map +1 -1
- package/build/modules/credentials/protocol/DidCommBaseCredentialProtocol.mjs.map +1 -1
- package/build/modules/credentials/protocol/DidCommCredentialProtocol.d.mts +1 -1
- package/build/modules/credentials/protocol/DidCommCredentialProtocol.d.ts +1 -1
- package/build/modules/credentials/protocol/DidCommCredentialProtocolOptions.d.mts +1 -1
- package/build/modules/credentials/protocol/DidCommCredentialProtocolOptions.d.ts +1 -1
- package/build/modules/credentials/protocol/index.js +1 -1
- package/build/modules/credentials/protocol/index.mjs +1 -1
- package/build/modules/credentials/protocol/revocation-notification/handlers/DidCommRevocationNotificationV1Handler.mjs.map +1 -1
- package/build/modules/credentials/protocol/revocation-notification/handlers/DidCommRevocationNotificationV2Handler.mjs.map +1 -1
- package/build/modules/credentials/protocol/revocation-notification/messages/DidCommRevocationNotificationV1Message.js +4 -4
- package/build/modules/credentials/protocol/revocation-notification/messages/DidCommRevocationNotificationV1Message.mjs +3 -3
- package/build/modules/credentials/protocol/revocation-notification/messages/DidCommRevocationNotificationV2Message.js +4 -4
- package/build/modules/credentials/protocol/revocation-notification/messages/DidCommRevocationNotificationV2Message.mjs +3 -3
- package/build/modules/credentials/protocol/revocation-notification/services/DidCommRevocationNotificationService.d.mts +1 -1
- package/build/modules/credentials/protocol/revocation-notification/services/DidCommRevocationNotificationService.d.mts.map +1 -1
- package/build/modules/credentials/protocol/revocation-notification/services/DidCommRevocationNotificationService.d.ts +1 -1
- package/build/modules/credentials/protocol/revocation-notification/services/DidCommRevocationNotificationService.d.ts.map +1 -1
- package/build/modules/credentials/protocol/revocation-notification/services/DidCommRevocationNotificationService.js +1 -1
- package/build/modules/credentials/protocol/revocation-notification/services/DidCommRevocationNotificationService.mjs +1 -1
- package/build/modules/credentials/protocol/revocation-notification/services/DidCommRevocationNotificationService.mjs.map +1 -1
- package/build/modules/credentials/protocol/v2/DidCommCredentialFormatCoordinator.js +2 -2
- package/build/modules/credentials/protocol/v2/DidCommCredentialFormatCoordinator.mjs +2 -2
- package/build/modules/credentials/protocol/v2/DidCommCredentialFormatCoordinator.mjs.map +1 -1
- package/build/modules/credentials/protocol/v2/DidCommCredentialV2Protocol.d.mts +2 -2
- package/build/modules/credentials/protocol/v2/DidCommCredentialV2Protocol.d.mts.map +1 -1
- package/build/modules/credentials/protocol/v2/DidCommCredentialV2Protocol.d.ts +2 -2
- package/build/modules/credentials/protocol/v2/DidCommCredentialV2Protocol.d.ts.map +1 -1
- package/build/modules/credentials/protocol/v2/DidCommCredentialV2Protocol.js +5 -5
- package/build/modules/credentials/protocol/v2/DidCommCredentialV2Protocol.mjs +5 -5
- package/build/modules/credentials/protocol/v2/DidCommCredentialV2Protocol.mjs.map +1 -1
- package/build/modules/credentials/protocol/v2/errors/DidCommCredentialV2ProblemReportError.d.mts +1 -1
- package/build/modules/credentials/protocol/v2/errors/DidCommCredentialV2ProblemReportError.d.mts.map +1 -1
- package/build/modules/credentials/protocol/v2/errors/DidCommCredentialV2ProblemReportError.d.ts +1 -1
- package/build/modules/credentials/protocol/v2/errors/DidCommCredentialV2ProblemReportError.d.ts.map +1 -1
- package/build/modules/credentials/protocol/v2/errors/DidCommCredentialV2ProblemReportError.mjs.map +1 -1
- package/build/modules/credentials/protocol/v2/handlers/DidCommIssueCredentialV2Handler.mjs.map +1 -1
- package/build/modules/credentials/protocol/v2/handlers/DidCommOfferCredentialV2Handler.d.mts.map +1 -1
- package/build/modules/credentials/protocol/v2/handlers/DidCommOfferCredentialV2Handler.d.ts.map +1 -1
- package/build/modules/credentials/protocol/v2/handlers/DidCommOfferCredentialV2Handler.mjs.map +1 -1
- package/build/modules/credentials/protocol/v2/handlers/DidCommProposeCredentialV2Handler.mjs.map +1 -1
- package/build/modules/credentials/protocol/v2/handlers/DidCommRequestCredentialV2Handler.mjs.map +1 -1
- package/build/modules/credentials/protocol/v2/handlers/index.js +1 -1
- package/build/modules/credentials/protocol/v2/handlers/index.mjs +1 -1
- package/build/modules/credentials/protocol/v2/index.js +1 -1
- package/build/modules/credentials/protocol/v2/index.mjs +1 -1
- package/build/modules/credentials/protocol/v2/messages/DidCommCredentialV2AckMessage.js +1 -1
- package/build/modules/credentials/protocol/v2/messages/DidCommCredentialV2AckMessage.mjs +1 -1
- package/build/modules/credentials/protocol/v2/messages/DidCommCredentialV2Preview.d.mts +1 -1
- package/build/modules/credentials/protocol/v2/messages/DidCommCredentialV2Preview.d.mts.map +1 -1
- package/build/modules/credentials/protocol/v2/messages/DidCommCredentialV2Preview.d.ts +1 -1
- package/build/modules/credentials/protocol/v2/messages/DidCommCredentialV2Preview.d.ts.map +1 -1
- package/build/modules/credentials/protocol/v2/messages/DidCommCredentialV2Preview.js +3 -3
- package/build/modules/credentials/protocol/v2/messages/DidCommCredentialV2Preview.mjs +2 -2
- package/build/modules/credentials/protocol/v2/messages/DidCommCredentialV2Preview.mjs.map +1 -1
- package/build/modules/credentials/protocol/v2/messages/DidCommCredentialV2ProblemReportMessage.js +1 -1
- package/build/modules/credentials/protocol/v2/messages/DidCommCredentialV2ProblemReportMessage.mjs +1 -1
- package/build/modules/credentials/protocol/v2/messages/DidCommIssueCredentialV2Message.js +4 -4
- package/build/modules/credentials/protocol/v2/messages/DidCommIssueCredentialV2Message.mjs +3 -3
- package/build/modules/credentials/protocol/v2/messages/DidCommOfferCredentialV2Message.js +4 -4
- package/build/modules/credentials/protocol/v2/messages/DidCommOfferCredentialV2Message.mjs +3 -3
- package/build/modules/credentials/protocol/v2/messages/DidCommProposeCredentialV2Message.js +4 -4
- package/build/modules/credentials/protocol/v2/messages/DidCommProposeCredentialV2Message.mjs +3 -3
- package/build/modules/credentials/protocol/v2/messages/DidCommRequestCredentialV2Message.js +4 -4
- package/build/modules/credentials/protocol/v2/messages/DidCommRequestCredentialV2Message.mjs +3 -3
- package/build/modules/credentials/protocol/v2/messages/index.js +1 -1
- package/build/modules/credentials/protocol/v2/messages/index.mjs +1 -1
- package/build/modules/credentials/repository/DidCommCredentialExchangeRecord.d.mts +2 -2
- package/build/modules/credentials/repository/DidCommCredentialExchangeRecord.d.mts.map +1 -1
- package/build/modules/credentials/repository/DidCommCredentialExchangeRecord.d.ts +2 -2
- package/build/modules/credentials/repository/DidCommCredentialExchangeRecord.d.ts.map +1 -1
- package/build/modules/credentials/repository/DidCommCredentialExchangeRecord.js +2 -2
- package/build/modules/credentials/repository/DidCommCredentialExchangeRecord.mjs +2 -2
- package/build/modules/credentials/repository/DidCommCredentialExchangeRecord.mjs.map +1 -1
- package/build/modules/credentials/repository/DidCommCredentialExchangeRepository.js +1 -1
- package/build/modules/credentials/repository/DidCommCredentialExchangeRepository.mjs +1 -1
- package/build/modules/credentials/repository/DidCommCredentialExchangeRepository.mjs.map +1 -1
- package/build/modules/discover-features/DidCommDiscoverFeaturesApi.d.mts +3 -3
- package/build/modules/discover-features/DidCommDiscoverFeaturesApi.d.mts.map +1 -1
- package/build/modules/discover-features/DidCommDiscoverFeaturesApi.d.ts +3 -3
- package/build/modules/discover-features/DidCommDiscoverFeaturesApi.d.ts.map +1 -1
- package/build/modules/discover-features/DidCommDiscoverFeaturesApi.js +3 -3
- package/build/modules/discover-features/DidCommDiscoverFeaturesApi.mjs +3 -3
- package/build/modules/discover-features/DidCommDiscoverFeaturesApi.mjs.map +1 -1
- package/build/modules/discover-features/DidCommDiscoverFeaturesEvents.d.mts +1 -1
- package/build/modules/discover-features/DidCommDiscoverFeaturesEvents.d.ts +1 -1
- package/build/modules/discover-features/DidCommDiscoverFeaturesModule.d.mts.map +1 -1
- package/build/modules/discover-features/DidCommDiscoverFeaturesModule.d.ts.map +1 -1
- package/build/modules/discover-features/DidCommDiscoverFeaturesModule.js +2 -2
- package/build/modules/discover-features/DidCommDiscoverFeaturesModule.mjs +2 -2
- package/build/modules/discover-features/DidCommDiscoverFeaturesModule.mjs.map +1 -1
- package/build/modules/discover-features/protocol/v1/DidCommDiscoverFeaturesV1Service.d.mts +2 -2
- package/build/modules/discover-features/protocol/v1/DidCommDiscoverFeaturesV1Service.d.mts.map +1 -1
- package/build/modules/discover-features/protocol/v1/DidCommDiscoverFeaturesV1Service.d.ts +2 -2
- package/build/modules/discover-features/protocol/v1/DidCommDiscoverFeaturesV1Service.d.ts.map +1 -1
- package/build/modules/discover-features/protocol/v1/DidCommDiscoverFeaturesV1Service.js +4 -4
- package/build/modules/discover-features/protocol/v1/DidCommDiscoverFeaturesV1Service.mjs +4 -4
- package/build/modules/discover-features/protocol/v1/DidCommDiscoverFeaturesV1Service.mjs.map +1 -1
- package/build/modules/discover-features/protocol/v1/handlers/DidCommFeaturesQueryMessageHandler.mjs.map +1 -1
- package/build/modules/discover-features/protocol/v1/messages/DidCommFeaturesDiscloseMessage.js +3 -3
- package/build/modules/discover-features/protocol/v1/messages/DidCommFeaturesDiscloseMessage.mjs +2 -2
- package/build/modules/discover-features/protocol/v1/messages/DidCommFeaturesQueryMessage.js +1 -1
- package/build/modules/discover-features/protocol/v1/messages/DidCommFeaturesQueryMessage.mjs +1 -1
- package/build/modules/discover-features/protocol/v2/DidCommDiscoverFeaturesV2Service.d.mts +2 -2
- package/build/modules/discover-features/protocol/v2/DidCommDiscoverFeaturesV2Service.d.mts.map +1 -1
- package/build/modules/discover-features/protocol/v2/DidCommDiscoverFeaturesV2Service.d.ts +2 -2
- package/build/modules/discover-features/protocol/v2/DidCommDiscoverFeaturesV2Service.d.ts.map +1 -1
- package/build/modules/discover-features/protocol/v2/DidCommDiscoverFeaturesV2Service.js +2 -2
- package/build/modules/discover-features/protocol/v2/DidCommDiscoverFeaturesV2Service.mjs +2 -2
- package/build/modules/discover-features/protocol/v2/DidCommDiscoverFeaturesV2Service.mjs.map +1 -1
- package/build/modules/discover-features/protocol/v2/handlers/DidCommFeaturesQueriesMessageHandler.mjs.map +1 -1
- package/build/modules/discover-features/protocol/v2/messages/DidCommFeaturesDisclosuresMessage.js +3 -3
- package/build/modules/discover-features/protocol/v2/messages/DidCommFeaturesDisclosuresMessage.mjs +2 -2
- package/build/modules/discover-features/protocol/v2/messages/DidCommFeaturesQueriesMessage.d.mts.map +1 -1
- package/build/modules/discover-features/protocol/v2/messages/DidCommFeaturesQueriesMessage.d.ts.map +1 -1
- package/build/modules/discover-features/protocol/v2/messages/DidCommFeaturesQueriesMessage.js +3 -3
- package/build/modules/discover-features/protocol/v2/messages/DidCommFeaturesQueriesMessage.mjs +2 -2
- package/build/modules/discover-features/protocol/v2/messages/DidCommFeaturesQueriesMessage.mjs.map +1 -1
- package/build/modules/discover-features/services/DidCommDiscoverFeaturesService.d.mts +1 -1
- package/build/modules/discover-features/services/DidCommDiscoverFeaturesService.d.ts +1 -1
- package/build/modules/index.js +66 -66
- package/build/modules/index.mjs +66 -66
- package/build/modules/message-pickup/DidCommMessagePickupApi.d.mts +1 -1
- package/build/modules/message-pickup/DidCommMessagePickupApi.d.mts.map +1 -1
- package/build/modules/message-pickup/DidCommMessagePickupApi.d.ts +1 -1
- package/build/modules/message-pickup/DidCommMessagePickupApi.d.ts.map +1 -1
- package/build/modules/message-pickup/DidCommMessagePickupApi.js +4 -4
- package/build/modules/message-pickup/DidCommMessagePickupApi.mjs +4 -4
- package/build/modules/message-pickup/DidCommMessagePickupApi.mjs.map +1 -1
- package/build/modules/message-pickup/DidCommMessagePickupModule.d.mts +1 -1
- package/build/modules/message-pickup/DidCommMessagePickupModule.d.mts.map +1 -1
- package/build/modules/message-pickup/DidCommMessagePickupModule.d.ts +1 -1
- package/build/modules/message-pickup/DidCommMessagePickupModule.d.ts.map +1 -1
- package/build/modules/message-pickup/DidCommMessagePickupModule.mjs.map +1 -1
- package/build/modules/message-pickup/index.js +1 -1
- package/build/modules/message-pickup/index.mjs +1 -1
- package/build/modules/message-pickup/protocol/DidCommBaseMessagePickupProtocol.d.mts +1 -1
- package/build/modules/message-pickup/protocol/DidCommBaseMessagePickupProtocol.d.ts +1 -1
- package/build/modules/message-pickup/protocol/DidCommMessagePickupProtocol.d.mts +1 -1
- package/build/modules/message-pickup/protocol/DidCommMessagePickupProtocol.d.ts +1 -1
- package/build/modules/message-pickup/protocol/index.js +1 -1
- package/build/modules/message-pickup/protocol/index.mjs +1 -1
- package/build/modules/message-pickup/protocol/v1/DidCommMessagePickupV1Protocol.d.mts +1 -1
- package/build/modules/message-pickup/protocol/v1/DidCommMessagePickupV1Protocol.d.mts.map +1 -1
- package/build/modules/message-pickup/protocol/v1/DidCommMessagePickupV1Protocol.d.ts +1 -1
- package/build/modules/message-pickup/protocol/v1/DidCommMessagePickupV1Protocol.d.ts.map +1 -1
- package/build/modules/message-pickup/protocol/v1/DidCommMessagePickupV1Protocol.js +3 -3
- package/build/modules/message-pickup/protocol/v1/DidCommMessagePickupV1Protocol.mjs +3 -3
- package/build/modules/message-pickup/protocol/v1/DidCommMessagePickupV1Protocol.mjs.map +1 -1
- package/build/modules/message-pickup/protocol/v1/handlers/DidCommBatchHandler.mjs.map +1 -1
- package/build/modules/message-pickup/protocol/v1/messages/DidCommBatchMessage.js +4 -4
- package/build/modules/message-pickup/protocol/v1/messages/DidCommBatchMessage.mjs +3 -3
- package/build/modules/message-pickup/protocol/v1/messages/DidCommBatchPickupMessage.js +3 -3
- package/build/modules/message-pickup/protocol/v1/messages/DidCommBatchPickupMessage.mjs +2 -2
- package/build/modules/message-pickup/protocol/v2/DidCommMessagePickupV2Protocol.d.mts +2 -2
- package/build/modules/message-pickup/protocol/v2/DidCommMessagePickupV2Protocol.d.mts.map +1 -1
- package/build/modules/message-pickup/protocol/v2/DidCommMessagePickupV2Protocol.d.ts +2 -2
- package/build/modules/message-pickup/protocol/v2/DidCommMessagePickupV2Protocol.d.ts.map +1 -1
- package/build/modules/message-pickup/protocol/v2/DidCommMessagePickupV2Protocol.js +5 -5
- package/build/modules/message-pickup/protocol/v2/DidCommMessagePickupV2Protocol.mjs +5 -5
- package/build/modules/message-pickup/protocol/v2/DidCommMessagePickupV2Protocol.mjs.map +1 -1
- package/build/modules/message-pickup/protocol/v2/handlers/DidCommMessageDeliveryV2Handler.mjs.map +1 -1
- package/build/modules/message-pickup/protocol/v2/handlers/DidCommStatusV2Handler.mjs.map +1 -1
- package/build/modules/message-pickup/protocol/v2/handlers/index.js +1 -1
- package/build/modules/message-pickup/protocol/v2/handlers/index.mjs +1 -1
- package/build/modules/message-pickup/protocol/v2/index.js +1 -1
- package/build/modules/message-pickup/protocol/v2/index.mjs +1 -1
- package/build/modules/message-pickup/protocol/v2/messages/DidCommDeliveryRequestV2Message.js +4 -4
- package/build/modules/message-pickup/protocol/v2/messages/DidCommDeliveryRequestV2Message.mjs +3 -3
- package/build/modules/message-pickup/protocol/v2/messages/DidCommLiveDeliveryChangeV2Message.js +4 -4
- package/build/modules/message-pickup/protocol/v2/messages/DidCommLiveDeliveryChangeV2Message.mjs +3 -3
- package/build/modules/message-pickup/protocol/v2/messages/DidCommMessageDeliveryV2Message.d.mts.map +1 -1
- package/build/modules/message-pickup/protocol/v2/messages/DidCommMessageDeliveryV2Message.d.ts.map +1 -1
- package/build/modules/message-pickup/protocol/v2/messages/DidCommMessageDeliveryV2Message.js +4 -4
- package/build/modules/message-pickup/protocol/v2/messages/DidCommMessageDeliveryV2Message.mjs +3 -3
- package/build/modules/message-pickup/protocol/v2/messages/DidCommMessageDeliveryV2Message.mjs.map +1 -1
- package/build/modules/message-pickup/protocol/v2/messages/DidCommMessagesReceivedV2Message.js +4 -4
- package/build/modules/message-pickup/protocol/v2/messages/DidCommMessagesReceivedV2Message.mjs +3 -3
- package/build/modules/message-pickup/protocol/v2/messages/DidCommStatusRequestV2Message.js +3 -3
- package/build/modules/message-pickup/protocol/v2/messages/DidCommStatusRequestV2Message.mjs +2 -2
- package/build/modules/message-pickup/protocol/v2/messages/DidCommStatusV2Message.js +4 -4
- package/build/modules/message-pickup/protocol/v2/messages/DidCommStatusV2Message.mjs +3 -3
- package/build/modules/message-pickup/protocol/v2/messages/index.js +1 -1
- package/build/modules/message-pickup/protocol/v2/messages/index.mjs +1 -1
- package/build/modules/message-pickup/services/DidCommMessagePickupSessionService.d.mts.map +1 -1
- package/build/modules/message-pickup/services/DidCommMessagePickupSessionService.d.ts.map +1 -1
- package/build/modules/message-pickup/services/DidCommMessagePickupSessionService.js +1 -1
- package/build/modules/message-pickup/services/DidCommMessagePickupSessionService.mjs +1 -1
- package/build/modules/message-pickup/services/DidCommMessagePickupSessionService.mjs.map +1 -1
- package/build/modules/oob/DidCommOutOfBandApi.d.mts +4 -4
- package/build/modules/oob/DidCommOutOfBandApi.d.mts.map +1 -1
- package/build/modules/oob/DidCommOutOfBandApi.d.ts +4 -4
- package/build/modules/oob/DidCommOutOfBandApi.d.ts.map +1 -1
- package/build/modules/oob/DidCommOutOfBandApi.js +16 -16
- package/build/modules/oob/DidCommOutOfBandApi.mjs +16 -16
- package/build/modules/oob/DidCommOutOfBandApi.mjs.map +1 -1
- package/build/modules/oob/DidCommOutOfBandModule.d.mts.map +1 -1
- package/build/modules/oob/DidCommOutOfBandModule.d.ts.map +1 -1
- package/build/modules/oob/DidCommOutOfBandModule.js +3 -3
- package/build/modules/oob/DidCommOutOfBandModule.mjs +3 -3
- package/build/modules/oob/DidCommOutOfBandModule.mjs.map +1 -1
- package/build/modules/oob/DidCommOutOfBandService.d.mts +2 -2
- package/build/modules/oob/DidCommOutOfBandService.d.mts.map +1 -1
- package/build/modules/oob/DidCommOutOfBandService.d.ts +2 -2
- package/build/modules/oob/DidCommOutOfBandService.d.ts.map +1 -1
- package/build/modules/oob/DidCommOutOfBandService.js +6 -6
- package/build/modules/oob/DidCommOutOfBandService.mjs +6 -6
- package/build/modules/oob/DidCommOutOfBandService.mjs.map +1 -1
- package/build/modules/oob/converters.js +1 -1
- package/build/modules/oob/converters.mjs +1 -1
- package/build/modules/oob/converters.mjs.map +1 -1
- package/build/modules/oob/domain/OutOfBandDidCommService.d.mts.map +1 -1
- package/build/modules/oob/domain/OutOfBandDidCommService.d.ts.map +1 -1
- package/build/modules/oob/domain/OutOfBandDidCommService.js +1 -1
- package/build/modules/oob/domain/OutOfBandDidCommService.mjs +1 -1
- package/build/modules/oob/domain/OutOfBandDidCommService.mjs.map +1 -1
- package/build/modules/oob/domain/index.js +2 -2
- package/build/modules/oob/domain/index.mjs +2 -2
- package/build/modules/oob/handlers/DidCommHandshakeReuseHandler.js +1 -1
- package/build/modules/oob/handlers/DidCommHandshakeReuseHandler.mjs +1 -1
- package/build/modules/oob/handlers/DidCommHandshakeReuseHandler.mjs.map +1 -1
- package/build/modules/oob/helpers.mjs.map +1 -1
- package/build/modules/oob/index.js +3 -3
- package/build/modules/oob/index.mjs +3 -3
- package/build/modules/oob/messages/DidCommHandshakeReuseAcceptedMessage.js +1 -1
- package/build/modules/oob/messages/DidCommHandshakeReuseAcceptedMessage.mjs +1 -1
- package/build/modules/oob/messages/DidCommHandshakeReuseMessage.js +1 -1
- package/build/modules/oob/messages/DidCommHandshakeReuseMessage.mjs +1 -1
- package/build/modules/oob/messages/DidCommOutOfBandInvitation.d.mts.map +1 -1
- package/build/modules/oob/messages/DidCommOutOfBandInvitation.d.ts.map +1 -1
- package/build/modules/oob/messages/DidCommOutOfBandInvitation.js +6 -6
- package/build/modules/oob/messages/DidCommOutOfBandInvitation.mjs +6 -6
- package/build/modules/oob/messages/DidCommOutOfBandInvitation.mjs.map +1 -1
- package/build/modules/oob/messages/index.js +1 -1
- package/build/modules/oob/messages/index.mjs +1 -1
- package/build/modules/oob/repository/DidCommOutOfBandRecord.d.mts.map +1 -1
- package/build/modules/oob/repository/DidCommOutOfBandRecord.d.ts.map +1 -1
- package/build/modules/oob/repository/DidCommOutOfBandRecord.js +2 -2
- package/build/modules/oob/repository/DidCommOutOfBandRecord.mjs +2 -2
- package/build/modules/oob/repository/DidCommOutOfBandRecord.mjs.map +1 -1
- package/build/modules/oob/repository/DidCommOutOfBandRepository.js +2 -2
- package/build/modules/oob/repository/DidCommOutOfBandRepository.mjs +2 -2
- package/build/modules/oob/repository/DidCommOutOfBandRepository.mjs.map +1 -1
- package/build/modules/proofs/DidCommProofsApi.d.mts.map +1 -1
- package/build/modules/proofs/DidCommProofsApi.d.ts.map +1 -1
- package/build/modules/proofs/DidCommProofsApi.js +3 -3
- package/build/modules/proofs/DidCommProofsApi.mjs +3 -3
- package/build/modules/proofs/DidCommProofsApi.mjs.map +1 -1
- package/build/modules/proofs/DidCommProofsApiOptions.d.mts +1 -1
- package/build/modules/proofs/DidCommProofsApiOptions.d.ts +1 -1
- package/build/modules/proofs/DidCommProofsModule.d.mts +1 -1
- package/build/modules/proofs/DidCommProofsModule.d.mts.map +1 -1
- package/build/modules/proofs/DidCommProofsModule.d.ts +1 -1
- package/build/modules/proofs/DidCommProofsModule.d.ts.map +1 -1
- package/build/modules/proofs/DidCommProofsModule.js +1 -1
- package/build/modules/proofs/DidCommProofsModule.mjs +1 -1
- package/build/modules/proofs/DidCommProofsModule.mjs.map +1 -1
- package/build/modules/proofs/DidCommProofsModuleConfig.d.mts.map +1 -1
- package/build/modules/proofs/DidCommProofsModuleConfig.d.ts.map +1 -1
- package/build/modules/proofs/DidCommProofsModuleConfig.mjs.map +1 -1
- package/build/modules/proofs/formats/DidCommProofFormatServiceOptions.d.mts +1 -1
- package/build/modules/proofs/formats/DidCommProofFormatServiceOptions.d.ts +1 -1
- package/build/modules/proofs/formats/dif-presentation-exchange/DidCommDifPresentationExchangeProofFormatService.d.mts.map +1 -1
- package/build/modules/proofs/formats/dif-presentation-exchange/DidCommDifPresentationExchangeProofFormatService.d.ts.map +1 -1
- package/build/modules/proofs/formats/dif-presentation-exchange/DidCommDifPresentationExchangeProofFormatService.mjs.map +1 -1
- package/build/modules/proofs/index.js +11 -11
- package/build/modules/proofs/index.mjs +11 -11
- package/build/modules/proofs/models/DidCommProofFormatSpec.js +3 -3
- package/build/modules/proofs/models/DidCommProofFormatSpec.mjs +2 -2
- package/build/modules/proofs/protocol/DidCommBaseProofProtocol.d.mts +1 -1
- package/build/modules/proofs/protocol/DidCommBaseProofProtocol.d.mts.map +1 -1
- package/build/modules/proofs/protocol/DidCommBaseProofProtocol.d.ts +1 -1
- package/build/modules/proofs/protocol/DidCommBaseProofProtocol.d.ts.map +1 -1
- package/build/modules/proofs/protocol/DidCommBaseProofProtocol.js +1 -1
- package/build/modules/proofs/protocol/DidCommBaseProofProtocol.mjs +1 -1
- package/build/modules/proofs/protocol/DidCommBaseProofProtocol.mjs.map +1 -1
- package/build/modules/proofs/protocol/DidCommProofProtocol.d.mts +1 -1
- package/build/modules/proofs/protocol/DidCommProofProtocol.d.ts +1 -1
- package/build/modules/proofs/protocol/DidCommProofProtocolOptions.d.mts +1 -1
- package/build/modules/proofs/protocol/DidCommProofProtocolOptions.d.ts +1 -1
- package/build/modules/proofs/protocol/index.js +1 -1
- package/build/modules/proofs/protocol/index.mjs +1 -1
- package/build/modules/proofs/protocol/v2/DidCommProofFormatCoordinator.js +1 -1
- package/build/modules/proofs/protocol/v2/DidCommProofFormatCoordinator.mjs +1 -1
- package/build/modules/proofs/protocol/v2/DidCommProofFormatCoordinator.mjs.map +1 -1
- package/build/modules/proofs/protocol/v2/DidCommProofV2Protocol.d.mts +4 -4
- package/build/modules/proofs/protocol/v2/DidCommProofV2Protocol.d.mts.map +1 -1
- package/build/modules/proofs/protocol/v2/DidCommProofV2Protocol.d.ts +4 -4
- package/build/modules/proofs/protocol/v2/DidCommProofV2Protocol.d.ts.map +1 -1
- package/build/modules/proofs/protocol/v2/DidCommProofV2Protocol.js +12 -12
- package/build/modules/proofs/protocol/v2/DidCommProofV2Protocol.mjs +12 -12
- package/build/modules/proofs/protocol/v2/DidCommProofV2Protocol.mjs.map +1 -1
- package/build/modules/proofs/protocol/v2/errors/V2PresentationProblemReportError.d.mts +1 -1
- package/build/modules/proofs/protocol/v2/errors/V2PresentationProblemReportError.d.mts.map +1 -1
- package/build/modules/proofs/protocol/v2/errors/V2PresentationProblemReportError.d.ts +1 -1
- package/build/modules/proofs/protocol/v2/errors/V2PresentationProblemReportError.d.ts.map +1 -1
- package/build/modules/proofs/protocol/v2/errors/V2PresentationProblemReportError.mjs.map +1 -1
- package/build/modules/proofs/protocol/v2/handlers/DidCommPresentationV2Handler.js +1 -1
- package/build/modules/proofs/protocol/v2/handlers/DidCommPresentationV2Handler.mjs +1 -1
- package/build/modules/proofs/protocol/v2/handlers/DidCommPresentationV2Handler.mjs.map +1 -1
- package/build/modules/proofs/protocol/v2/handlers/DidCommProposePresentationV2Handler.mjs.map +1 -1
- package/build/modules/proofs/protocol/v2/handlers/DidCommRequestPresentationV2Handler.mjs.map +1 -1
- package/build/modules/proofs/protocol/v2/messages/DidCommPresentationV2AckMessage.js +1 -1
- package/build/modules/proofs/protocol/v2/messages/DidCommPresentationV2AckMessage.mjs +1 -1
- package/build/modules/proofs/protocol/v2/messages/DidCommPresentationV2Message.js +4 -4
- package/build/modules/proofs/protocol/v2/messages/DidCommPresentationV2Message.mjs +3 -3
- package/build/modules/proofs/protocol/v2/messages/DidCommPresentationV2ProblemReportMessage.js +1 -1
- package/build/modules/proofs/protocol/v2/messages/DidCommPresentationV2ProblemReportMessage.mjs +1 -1
- package/build/modules/proofs/protocol/v2/messages/DidCommProposePresentationV2Message.js +4 -4
- package/build/modules/proofs/protocol/v2/messages/DidCommProposePresentationV2Message.mjs +3 -3
- package/build/modules/proofs/protocol/v2/messages/DidCommRequestPresentationV2Message.js +4 -4
- package/build/modules/proofs/protocol/v2/messages/DidCommRequestPresentationV2Message.mjs +3 -3
- package/build/modules/proofs/repository/DidCommProofExchangeRecord.d.mts +1 -1
- package/build/modules/proofs/repository/DidCommProofExchangeRecord.d.mts.map +1 -1
- package/build/modules/proofs/repository/DidCommProofExchangeRecord.d.ts +1 -1
- package/build/modules/proofs/repository/DidCommProofExchangeRecord.d.ts.map +1 -1
- package/build/modules/proofs/repository/DidCommProofExchangeRecord.mjs.map +1 -1
- package/build/modules/proofs/repository/DidCommProofExchangeRepository.js +1 -1
- package/build/modules/proofs/repository/DidCommProofExchangeRepository.mjs +1 -1
- package/build/modules/proofs/repository/DidCommProofExchangeRepository.mjs.map +1 -1
- package/build/modules/routing/DidCommMediationRecipientApi.d.mts +3 -3
- package/build/modules/routing/DidCommMediationRecipientApi.d.mts.map +1 -1
- package/build/modules/routing/DidCommMediationRecipientApi.d.ts +3 -3
- package/build/modules/routing/DidCommMediationRecipientApi.d.ts.map +1 -1
- package/build/modules/routing/DidCommMediationRecipientApi.js +8 -8
- package/build/modules/routing/DidCommMediationRecipientApi.mjs +8 -8
- package/build/modules/routing/DidCommMediationRecipientApi.mjs.map +1 -1
- package/build/modules/routing/DidCommMediationRecipientModule.d.mts.map +1 -1
- package/build/modules/routing/DidCommMediationRecipientModule.d.ts.map +1 -1
- package/build/modules/routing/DidCommMediationRecipientModule.js +4 -4
- package/build/modules/routing/DidCommMediationRecipientModule.mjs +4 -4
- package/build/modules/routing/DidCommMediationRecipientModule.mjs.map +1 -1
- package/build/modules/routing/DidCommMediatorApi.d.mts +1 -1
- package/build/modules/routing/DidCommMediatorApi.d.mts.map +1 -1
- package/build/modules/routing/DidCommMediatorApi.d.ts +1 -1
- package/build/modules/routing/DidCommMediatorApi.d.ts.map +1 -1
- package/build/modules/routing/DidCommMediatorApi.js +2 -2
- package/build/modules/routing/DidCommMediatorApi.mjs +2 -2
- package/build/modules/routing/DidCommMediatorApi.mjs.map +1 -1
- package/build/modules/routing/DidCommMediatorModule.d.mts.map +1 -1
- package/build/modules/routing/DidCommMediatorModule.d.ts.map +1 -1
- package/build/modules/routing/DidCommMediatorModule.js +7 -7
- package/build/modules/routing/DidCommMediatorModule.mjs +7 -7
- package/build/modules/routing/DidCommMediatorModule.mjs.map +1 -1
- package/build/modules/routing/handlers/DidCommForwardHandler.mjs.map +1 -1
- package/build/modules/routing/handlers/DidCommKeylistUpdateHandler.mjs.map +1 -1
- package/build/modules/routing/handlers/DidCommKeylistUpdateResponseHandler.mjs.map +1 -1
- package/build/modules/routing/handlers/DidCommMediationDenyHandler.mjs.map +1 -1
- package/build/modules/routing/handlers/DidCommMediationGrantHandler.mjs.map +1 -1
- package/build/modules/routing/handlers/DidCommMediationRequestHandler.mjs.map +1 -1
- package/build/modules/routing/handlers/index.js +1 -1
- package/build/modules/routing/handlers/index.mjs +1 -1
- package/build/modules/routing/index.js +4 -4
- package/build/modules/routing/index.mjs +4 -4
- package/build/modules/routing/messages/DidCommForwardMessage.js +3 -3
- package/build/modules/routing/messages/DidCommForwardMessage.mjs +2 -2
- package/build/modules/routing/messages/DidCommKeylistUpdateMessage.js +3 -3
- package/build/modules/routing/messages/DidCommKeylistUpdateMessage.mjs +2 -2
- package/build/modules/routing/messages/DidCommKeylistUpdateResponseMessage.js +3 -3
- package/build/modules/routing/messages/DidCommKeylistUpdateResponseMessage.mjs +2 -2
- package/build/modules/routing/messages/DidCommMediationDenyMessage.js +1 -1
- package/build/modules/routing/messages/DidCommMediationDenyMessage.mjs +1 -1
- package/build/modules/routing/messages/DidCommMediationGrantMessage.js +3 -3
- package/build/modules/routing/messages/DidCommMediationGrantMessage.mjs +2 -2
- package/build/modules/routing/messages/DidCommMediationRequestMessage.js +1 -1
- package/build/modules/routing/messages/DidCommMediationRequestMessage.mjs +1 -1
- package/build/modules/routing/messages/index.js +1 -1
- package/build/modules/routing/messages/index.mjs +1 -1
- package/build/modules/routing/repository/DidCommMediationRecord.d.mts +1 -1
- package/build/modules/routing/repository/DidCommMediationRecord.d.mts.map +1 -1
- package/build/modules/routing/repository/DidCommMediationRecord.d.ts +1 -1
- package/build/modules/routing/repository/DidCommMediationRecord.d.ts.map +1 -1
- package/build/modules/routing/repository/DidCommMediationRecord.js +1 -1
- package/build/modules/routing/repository/DidCommMediationRecord.mjs +1 -1
- package/build/modules/routing/repository/DidCommMediationRecord.mjs.map +1 -1
- package/build/modules/routing/repository/DidCommMediationRepository.js +1 -1
- package/build/modules/routing/repository/DidCommMediationRepository.mjs +1 -1
- package/build/modules/routing/repository/DidCommMediationRepository.mjs.map +1 -1
- package/build/modules/routing/repository/DidCommMediatorRoutingRepository.js +1 -1
- package/build/modules/routing/repository/DidCommMediatorRoutingRepository.mjs +1 -1
- package/build/modules/routing/repository/DidCommMediatorRoutingRepository.mjs.map +1 -1
- package/build/modules/routing/services/DidCommMediationRecipientService.d.mts +2 -2
- package/build/modules/routing/services/DidCommMediationRecipientService.d.mts.map +1 -1
- package/build/modules/routing/services/DidCommMediationRecipientService.d.ts +2 -2
- package/build/modules/routing/services/DidCommMediationRecipientService.d.ts.map +1 -1
- package/build/modules/routing/services/DidCommMediationRecipientService.js +4 -4
- package/build/modules/routing/services/DidCommMediationRecipientService.mjs +4 -4
- package/build/modules/routing/services/DidCommMediationRecipientService.mjs.map +1 -1
- package/build/modules/routing/services/DidCommMediatorService.d.mts.map +1 -1
- package/build/modules/routing/services/DidCommMediatorService.d.ts.map +1 -1
- package/build/modules/routing/services/DidCommMediatorService.js +3 -3
- package/build/modules/routing/services/DidCommMediatorService.mjs +3 -3
- package/build/modules/routing/services/DidCommMediatorService.mjs.map +1 -1
- package/build/modules/routing/services/DidCommRoutingService.d.mts.map +1 -1
- package/build/modules/routing/services/DidCommRoutingService.d.ts.map +1 -1
- package/build/modules/routing/services/DidCommRoutingService.js +1 -1
- package/build/modules/routing/services/DidCommRoutingService.mjs +1 -1
- package/build/modules/routing/services/DidCommRoutingService.mjs.map +1 -1
- package/build/repository/DidCommMessageRecord.d.mts.map +1 -1
- package/build/repository/DidCommMessageRecord.d.ts.map +1 -1
- package/build/repository/DidCommMessageRecord.mjs.map +1 -1
- package/build/repository/DidCommMessageRepository.d.mts.map +1 -1
- package/build/repository/DidCommMessageRepository.d.ts.map +1 -1
- package/build/repository/DidCommMessageRepository.js +1 -1
- package/build/repository/DidCommMessageRepository.mjs +1 -1
- package/build/repository/DidCommMessageRepository.mjs.map +1 -1
- package/build/repository/index.js +1 -1
- package/build/repository/index.mjs +1 -1
- package/build/services/DidCommDocumentService.d.mts.map +1 -1
- package/build/services/DidCommDocumentService.d.ts.map +1 -1
- package/build/services/DidCommDocumentService.js +1 -1
- package/build/services/DidCommDocumentService.mjs +1 -1
- package/build/services/DidCommDocumentService.mjs.map +1 -1
- package/build/transport/DidCommHttpOutboundTransport.d.mts.map +1 -1
- package/build/transport/DidCommHttpOutboundTransport.d.ts.map +1 -1
- package/build/transport/DidCommHttpOutboundTransport.js +3 -3
- package/build/transport/DidCommHttpOutboundTransport.mjs +3 -3
- package/build/transport/DidCommHttpOutboundTransport.mjs.map +1 -1
- package/build/transport/DidCommWsOutboundTransport.d.mts.map +1 -1
- package/build/transport/DidCommWsOutboundTransport.d.ts.map +1 -1
- package/build/transport/DidCommWsOutboundTransport.mjs.map +1 -1
- package/build/transport/index.js +2 -2
- package/build/transport/index.mjs +2 -2
- package/build/transport/queue/DidCommQueueTransportRepository.d.mts +1 -1
- package/build/transport/queue/DidCommQueueTransportRepository.d.ts +1 -1
- package/build/transport/queue/InMemoryQueueTransportRepository.d.mts +1 -1
- package/build/transport/queue/InMemoryQueueTransportRepository.d.mts.map +1 -1
- package/build/transport/queue/InMemoryQueueTransportRepository.d.ts +1 -1
- package/build/transport/queue/InMemoryQueueTransportRepository.d.ts.map +1 -1
- package/build/transport/queue/InMemoryQueueTransportRepository.js +1 -1
- package/build/transport/queue/InMemoryQueueTransportRepository.mjs +1 -1
- package/build/transport/queue/InMemoryQueueTransportRepository.mjs.map +1 -1
- package/build/transport/queue/index.js +1 -1
- package/build/transport/queue/index.mjs +1 -1
- package/build/updates/0.1-0.2/connection.js +3 -3
- package/build/updates/0.1-0.2/connection.mjs +3 -3
- package/build/updates/0.1-0.2/connection.mjs.map +1 -1
- package/build/updates/0.1-0.2/credential.js +1 -1
- package/build/updates/0.1-0.2/credential.mjs +1 -1
- package/build/updates/0.1-0.2/credential.mjs.map +1 -1
- package/build/updates/0.2-0.3/proof.js +1 -1
- package/build/updates/0.2-0.3/proof.mjs +1 -1
- package/build/updates/0.2-0.3/proof.mjs.map +1 -1
- package/build/updates/0.4-0.5/credentialExchangeRecord.js +2 -2
- package/build/updates/0.4-0.5/credentialExchangeRecord.mjs +2 -2
- package/build/updates/0.4-0.5/credentialExchangeRecord.mjs.map +1 -1
- package/build/updates/0.4-0.5/proofExchangeRecord.js +2 -2
- package/build/updates/0.4-0.5/proofExchangeRecord.mjs +2 -2
- package/build/util/DidCommLinkedAttachment.js +3 -3
- package/build/util/DidCommLinkedAttachment.mjs +2 -2
- package/build/util/JWE.mjs.map +1 -1
- package/build/util/attachment.d.mts.map +1 -1
- package/build/util/attachment.d.ts.map +1 -1
- package/build/util/attachment.mjs.map +1 -1
- package/build/util/messageType.d.mts +37 -1
- package/build/util/messageType.d.mts.map +1 -1
- package/build/util/messageType.d.ts +37 -1
- package/build/util/messageType.d.ts.map +1 -1
- package/build/util/messageType.js +4 -4
- package/build/util/messageType.mjs +4 -4
- package/build/util/messageType.mjs.map +1 -1
- package/build/util/parseInvitation.d.mts +8 -1
- package/build/util/parseInvitation.d.mts.map +1 -1
- package/build/util/parseInvitation.d.ts +8 -1
- package/build/util/parseInvitation.d.ts.map +1 -1
- package/build/util/parseInvitation.js +6 -5
- package/build/util/parseInvitation.mjs +7 -7
- package/build/util/parseInvitation.mjs.map +1 -1
- package/package.json +7 -7
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { DidCommMessage } from "../../../DidCommMessage.js";
|
|
2
2
|
import { DidCommDidExchangeState } from "../models/DidCommDidExchangeState.js";
|
|
3
|
-
import { DidCommDidExchangeRole } from "../models/DidCommDidExchangeRole.js";
|
|
4
3
|
import { DidCommConnectionType } from "../models/DidCommConnectionType.js";
|
|
4
|
+
import { DidCommDidExchangeRole } from "../models/DidCommDidExchangeRole.js";
|
|
5
|
+
import { DidCommAckMessage } from "../../../messages/common/DidCommAckMessage.js";
|
|
6
|
+
import { DidCommConnectionProblemReportMessage } from "../messages/DidCommConnectionProblemReportMessage.js";
|
|
5
7
|
import { DidCommConnectionRequestMessage } from "../messages/DidCommConnectionRequestMessage.js";
|
|
6
8
|
import { DidCommConnectionResponseMessage } from "../messages/DidCommConnectionResponseMessage.js";
|
|
7
9
|
import { DidCommTrustPingMessage } from "../messages/DidCommTrustPingMessage.js";
|
|
8
|
-
import { DidCommAckMessage } from "../../../messages/common/DidCommAckMessage.js";
|
|
9
|
-
import { DidCommConnectionProblemReportMessage } from "../messages/DidCommConnectionProblemReportMessage.js";
|
|
10
10
|
import { DidCommOutOfBandRecord } from "../../oob/repository/DidCommOutOfBandRecord.js";
|
|
11
11
|
import { DidCommConnectionRecord, DidCommConnectionRecordProps } from "../repository/DidCommConnectionRecord.js";
|
|
12
12
|
import { DidCommConnectionRepository } from "../repository/DidCommConnectionRepository.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DidCommConnectionService.d.ts","names":[],"sources":["../../../../src/modules/connections/services/DidCommConnectionService.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"DidCommConnectionService.d.ts","names":[],"sources":["../../../../src/modules/connections/services/DidCommConnectionService.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;;;;UA4DiB,uBAAA;;;;WAIN;EAJM,oBAAA,CAAA,EAAA,OAAuB;AAQxC;AACqC,cAAxB,wBAAA,CAAwB;UAOQ,oBAAA;UACnB,aAAA;UACP,YAAA;UACD,MAAA;aAgBA,CAAA,MAAA,EAnB2B,MAmB3B,EAAA,oBAAA,EAlBQ,2BAkBR,EAAA,aAAA,EAjBC,aAiBD,EAAA,YAAA,EAhBA,YAgBA;;;;;;;;eAgEG,CAAA,YAAA,EAhEH,YAgEG,EAAA,eAAA,EA/DA,sBA+DA,EAAA,MAAA,EA9DT,uBA8DS,CAAA,EA7DhB,OA6DgB,CA7DR,+BA6DQ,CA7DwB,+BA6DxB,CAAA,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P6B,OA0P7B,CA1PqC,uBA0PrC,GAAA,IAAA,CAAA;cAAqB,CAAA,YAAA,EAtP3B,YAsP2B,EAAA,MAAA,EAAA,MAAA,CAAA,EAtPI,OAsPJ,CAtPY,uBAsPZ,GAAA,IAAA,CAAA;sBAC1D,CAAA,YAAA,EAnPuC,YAmPvC,EAAA,WAAA,EAAA,MAAA,CAAA,EAnPwE,OAmPxE,CAnPwE,uBAmPxE,EAAA,CAAA;0BACS,CAAA,YAAA,EA/OF,YA+OE,EAAA,eAAA,EA9OC,KA8OD,CA9OO,qBA8OP,GAAA,MAAA,CAAA,CAAA,EA9OsC,OA8OtC,CA9OsC,uBA8OtC,EAAA,CAAA;EAAuB,mBAAA,CAAA,YAAA,EAzOM,YAyON,EAAA,aAAA,EAAA,MAAA,CAAA,EAzOyC,OAyOzC,CAzOyC,uBAyOzC,EAAA,CAAA;2BApOzB;;;;eAIE,GAAA,CAAI,UAAU,GAAA,CAAI;kBAAiC,GAAA,CAAI,UAAU,GAAA,CAAI;MAAmB,QAAA;+BAsB1F,qBACP,MAAM,yCACE,eACd,QAAQ;iCAKK,uBACL,+BACR,QAAQ;kCAMkC,gCAAgC,wCAAqC;qCAOlG,gCACI,wCACN;uCAMoC,0BAAuB;;;;sCAuIzD,yDAGb,QAAQ;;UA+BI,oDAAoD;WAC1D;oBACS"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.js');
|
|
2
|
-
const require_decorateMetadata = require('../../../_virtual/_@oxc-project_runtime@0.94.0/helpers/decorateMetadata.js');
|
|
3
2
|
const require_decorate = require('../../../_virtual/_@oxc-project_runtime@0.94.0/helpers/decorate.js');
|
|
3
|
+
const require_decorateMetadata = require('../../../_virtual/_@oxc-project_runtime@0.94.0/helpers/decorateMetadata.js');
|
|
4
4
|
const require_Ed25119Sig2018 = require('../models/did/publicKey/Ed25119Sig2018.js');
|
|
5
5
|
const require_ReferencedAuthentication = require('../models/did/authentication/ReferencedAuthentication.js');
|
|
6
6
|
const require_index = require('../models/did/authentication/index.js');
|
|
@@ -10,6 +10,18 @@ const require_DidCommDidExchangeState = require('../models/DidCommDidExchangeSta
|
|
|
10
10
|
const require_DidCommDidExchangeRole = require('../models/DidCommDidExchangeRole.js');
|
|
11
11
|
const require_DidCommHandshakeProtocol = require('../models/DidCommHandshakeProtocol.js');
|
|
12
12
|
require('../models/index.js');
|
|
13
|
+
const require_helpers = require('./helpers.js');
|
|
14
|
+
const require_DidCommOutOfBandRole = require('../../oob/domain/DidCommOutOfBandRole.js');
|
|
15
|
+
const require_DidCommOutOfBandInvitation = require('../../oob/messages/DidCommOutOfBandInvitation.js');
|
|
16
|
+
require('../../oob/messages/index.js');
|
|
17
|
+
const require_decorateParam = require('../../../_virtual/_@oxc-project_runtime@0.94.0/helpers/decorateParam.js');
|
|
18
|
+
const require_DidCommOutOfBandRepository = require('../../oob/repository/DidCommOutOfBandRepository.js');
|
|
19
|
+
const require_outOfBandRecordMetadataTypes = require('../../oob/repository/outOfBandRecordMetadataTypes.js');
|
|
20
|
+
const require_SignatureDecoratorUtils = require('../../../decorators/signature/SignatureDecoratorUtils.js');
|
|
21
|
+
const require_DidCommOutOfBandState = require('../../oob/domain/DidCommOutOfBandState.js');
|
|
22
|
+
require('../../oob/repository/index.js');
|
|
23
|
+
const require_DidCommOutOfBandService = require('../../oob/DidCommOutOfBandService.js');
|
|
24
|
+
const require_DidCommConnectionEvents = require('../DidCommConnectionEvents.js');
|
|
13
25
|
const require_DidCommConnectionRequestMessage = require('../messages/DidCommConnectionRequestMessage.js');
|
|
14
26
|
const require_DidCommConnectionResponseMessage = require('../messages/DidCommConnectionResponseMessage.js');
|
|
15
27
|
const require_DidCommTrustPingMessage = require('../messages/DidCommTrustPingMessage.js');
|
|
@@ -17,21 +29,9 @@ require('../messages/index.js');
|
|
|
17
29
|
const require_ConnectionProblemReportError = require('../errors/ConnectionProblemReportError.js');
|
|
18
30
|
const require_ConnectionProblemReportReason = require('../errors/ConnectionProblemReportReason.js');
|
|
19
31
|
require('../errors/index.js');
|
|
20
|
-
const require_DidCommOutOfBandState = require('../../oob/domain/DidCommOutOfBandState.js');
|
|
21
32
|
const require_DidCommConnectionRecord = require('../repository/DidCommConnectionRecord.js');
|
|
22
|
-
const require_decorateParam = require('../../../_virtual/_@oxc-project_runtime@0.94.0/helpers/decorateParam.js');
|
|
23
33
|
const require_DidCommConnectionRepository = require('../repository/DidCommConnectionRepository.js');
|
|
24
34
|
require('../repository/index.js');
|
|
25
|
-
const require_SignatureDecoratorUtils = require('../../../decorators/signature/SignatureDecoratorUtils.js');
|
|
26
|
-
const require_helpers = require('./helpers.js');
|
|
27
|
-
const require_DidCommOutOfBandRole = require('../../oob/domain/DidCommOutOfBandRole.js');
|
|
28
|
-
const require_DidCommOutOfBandInvitation = require('../../oob/messages/DidCommOutOfBandInvitation.js');
|
|
29
|
-
require('../../oob/messages/index.js');
|
|
30
|
-
const require_DidCommOutOfBandRepository = require('../../oob/repository/DidCommOutOfBandRepository.js');
|
|
31
|
-
require('../../oob/repository/index.js');
|
|
32
|
-
const require_DidCommOutOfBandService = require('../../oob/DidCommOutOfBandService.js');
|
|
33
|
-
const require_outOfBandRecordMetadataTypes = require('../../oob/repository/outOfBandRecordMetadataTypes.js');
|
|
34
|
-
const require_DidCommConnectionEvents = require('../DidCommConnectionEvents.js');
|
|
35
35
|
let __credo_ts_core = require("@credo-ts/core");
|
|
36
36
|
__credo_ts_core = require_rolldown_runtime.__toESM(__credo_ts_core);
|
|
37
37
|
let rxjs = require("rxjs");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { __decorateMetadata } from "../../../_virtual/_@oxc-project_runtime@0.94.0/helpers/decorateMetadata.mjs";
|
|
2
1
|
import { __decorate } from "../../../_virtual/_@oxc-project_runtime@0.94.0/helpers/decorate.mjs";
|
|
2
|
+
import { __decorateMetadata } from "../../../_virtual/_@oxc-project_runtime@0.94.0/helpers/decorateMetadata.mjs";
|
|
3
3
|
import { Ed25119Sig2018 } from "../models/did/publicKey/Ed25119Sig2018.mjs";
|
|
4
4
|
import { ReferencedAuthentication } from "../models/did/authentication/ReferencedAuthentication.mjs";
|
|
5
5
|
import { authenticationTypes } from "../models/did/authentication/index.mjs";
|
|
@@ -9,6 +9,18 @@ import { DidCommDidExchangeState } from "../models/DidCommDidExchangeState.mjs";
|
|
|
9
9
|
import { DidCommDidExchangeRole } from "../models/DidCommDidExchangeRole.mjs";
|
|
10
10
|
import { DidCommHandshakeProtocol } from "../models/DidCommHandshakeProtocol.mjs";
|
|
11
11
|
import "../models/index.mjs";
|
|
12
|
+
import { assertNoCreatedDidExistsForKeys, convertToNewDidDocument, getResolvedDidcommServiceWithSigningKeyId } from "./helpers.mjs";
|
|
13
|
+
import { DidCommOutOfBandRole } from "../../oob/domain/DidCommOutOfBandRole.mjs";
|
|
14
|
+
import { DidCommInvitationType } from "../../oob/messages/DidCommOutOfBandInvitation.mjs";
|
|
15
|
+
import "../../oob/messages/index.mjs";
|
|
16
|
+
import { __decorateParam } from "../../../_virtual/_@oxc-project_runtime@0.94.0/helpers/decorateParam.mjs";
|
|
17
|
+
import { DidCommOutOfBandRepository } from "../../oob/repository/DidCommOutOfBandRepository.mjs";
|
|
18
|
+
import { DidCommOutOfBandRecordMetadataKeys } from "../../oob/repository/outOfBandRecordMetadataTypes.mjs";
|
|
19
|
+
import { signData, unpackAndVerifySignatureDecorator } from "../../../decorators/signature/SignatureDecoratorUtils.mjs";
|
|
20
|
+
import { DidCommOutOfBandState } from "../../oob/domain/DidCommOutOfBandState.mjs";
|
|
21
|
+
import "../../oob/repository/index.mjs";
|
|
22
|
+
import { DidCommOutOfBandService } from "../../oob/DidCommOutOfBandService.mjs";
|
|
23
|
+
import { DidCommConnectionEventTypes } from "../DidCommConnectionEvents.mjs";
|
|
12
24
|
import { DidCommConnectionRequestMessage } from "../messages/DidCommConnectionRequestMessage.mjs";
|
|
13
25
|
import { DidCommConnectionResponseMessage } from "../messages/DidCommConnectionResponseMessage.mjs";
|
|
14
26
|
import { DidCommTrustPingMessage } from "../messages/DidCommTrustPingMessage.mjs";
|
|
@@ -16,21 +28,9 @@ import "../messages/index.mjs";
|
|
|
16
28
|
import { ConnectionProblemReportError } from "../errors/ConnectionProblemReportError.mjs";
|
|
17
29
|
import { ConnectionProblemReportReason } from "../errors/ConnectionProblemReportReason.mjs";
|
|
18
30
|
import "../errors/index.mjs";
|
|
19
|
-
import { DidCommOutOfBandState } from "../../oob/domain/DidCommOutOfBandState.mjs";
|
|
20
31
|
import { DidCommConnectionRecord } from "../repository/DidCommConnectionRecord.mjs";
|
|
21
|
-
import { __decorateParam } from "../../../_virtual/_@oxc-project_runtime@0.94.0/helpers/decorateParam.mjs";
|
|
22
32
|
import { DidCommConnectionRepository } from "../repository/DidCommConnectionRepository.mjs";
|
|
23
33
|
import "../repository/index.mjs";
|
|
24
|
-
import { signData, unpackAndVerifySignatureDecorator } from "../../../decorators/signature/SignatureDecoratorUtils.mjs";
|
|
25
|
-
import { assertNoCreatedDidExistsForKeys, convertToNewDidDocument, getResolvedDidcommServiceWithSigningKeyId } from "./helpers.mjs";
|
|
26
|
-
import { DidCommOutOfBandRole } from "../../oob/domain/DidCommOutOfBandRole.mjs";
|
|
27
|
-
import { DidCommInvitationType } from "../../oob/messages/DidCommOutOfBandInvitation.mjs";
|
|
28
|
-
import "../../oob/messages/index.mjs";
|
|
29
|
-
import { DidCommOutOfBandRepository } from "../../oob/repository/DidCommOutOfBandRepository.mjs";
|
|
30
|
-
import "../../oob/repository/index.mjs";
|
|
31
|
-
import { DidCommOutOfBandService } from "../../oob/DidCommOutOfBandService.mjs";
|
|
32
|
-
import { DidCommOutOfBandRecordMetadataKeys } from "../../oob/repository/outOfBandRecordMetadataTypes.mjs";
|
|
33
|
-
import { DidCommConnectionEventTypes } from "../DidCommConnectionEvents.mjs";
|
|
34
34
|
import { CredoError, DidDocumentRole, DidRecord, DidRecordMetadataKeys, DidRepository, DidsApi, EventEmitter, IndyAgentService, InjectionSymbols, JsonTransformer, Kms, TypedArrayEncoder, didDocumentJsonToNumAlgo1Did, filterContextCorrelationId, inject, injectable, parseDid, utils } from "@credo-ts/core";
|
|
35
35
|
import { ReplaySubject, firstValueFrom } from "rxjs";
|
|
36
36
|
import { first as first$1, map as map$1, timeout as timeout$1 } from "rxjs/operators";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DidCommConnectionService.mjs","names":["DidCommConnectionService","logger: Logger","didDoc: DidDoc","keys: DidDocumentKey[]","signingKey: Kms.PublicJwk<Kms.Ed25519PublicJwk>","service","connection","map","first","timeout"],"sources":["../../../../src/modules/connections/services/DidCommConnectionService.ts"],"sourcesContent":["import type { AgentContext, DidDocumentKey, Query, QueryOptions } from '@credo-ts/core'\nimport type { DidCommMessage } from '../../../DidCommMessage'\nimport type { DidCommAckMessage } from '../../../messages'\nimport type { DidCommInboundMessageContext } from '../../../models'\nimport type { DidCommOutOfBandRecord } from '../../oob/repository'\nimport type { DidCommConnectionStateChangedEvent } from '../DidCommConnectionEvents'\nimport type { DidCommConnectionProblemReportMessage } from '../messages'\nimport type { DidCommConnectionType } from '../models'\nimport type { DidCommConnectionRecordProps } from '../repository'\n\nimport {\n CredoError,\n DidDocumentRole,\n DidRecord,\n DidRecordMetadataKeys,\n DidRepository,\n DidsApi,\n EventEmitter,\n IndyAgentService,\n InjectionSymbols,\n JsonTransformer,\n Kms,\n type Logger,\n TypedArrayEncoder,\n didDocumentJsonToNumAlgo1Did,\n filterContextCorrelationId,\n inject,\n injectable,\n parseDid,\n utils,\n} from '@credo-ts/core'\nimport { ReplaySubject, firstValueFrom } from 'rxjs'\nimport { first, map, timeout } from 'rxjs/operators'\nimport { signData, unpackAndVerifySignatureDecorator } from '../../../decorators/signature/SignatureDecoratorUtils'\nimport type { DidCommRouting } from '../../../models'\nimport { DidCommOutOfBandService } from '../../oob/DidCommOutOfBandService'\nimport { DidCommOutOfBandRole } from '../../oob/domain/DidCommOutOfBandRole'\nimport { DidCommOutOfBandState } from '../../oob/domain/DidCommOutOfBandState'\nimport { DidCommInvitationType } from '../../oob/messages'\nimport { DidCommOutOfBandRepository } from '../../oob/repository'\nimport { DidCommOutOfBandRecordMetadataKeys } from '../../oob/repository/outOfBandRecordMetadataTypes'\nimport { DidCommConnectionEventTypes } from '../DidCommConnectionEvents'\nimport { ConnectionProblemReportError, ConnectionProblemReportReason } from '../errors'\nimport { DidCommConnectionRequestMessage, DidCommConnectionResponseMessage, DidCommTrustPingMessage } from '../messages'\nimport {\n DidCommConnection,\n DidCommDidExchangeRole,\n DidCommDidExchangeState,\n DidCommHandshakeProtocol,\n DidDoc,\n Ed25119Sig2018,\n ReferencedAuthentication,\n authenticationTypes,\n} from '../models'\nimport { DidCommConnectionRecord, DidCommConnectionRepository } from '../repository'\n\nimport {\n assertNoCreatedDidExistsForKeys,\n convertToNewDidDocument,\n getResolvedDidcommServiceWithSigningKeyId,\n} from './helpers'\n\nexport interface ConnectionRequestParams {\n label: string\n imageUrl?: string\n alias?: string\n routing: DidCommRouting\n autoAcceptConnection?: boolean\n}\n\n@injectable()\nexport class DidCommConnectionService {\n private connectionRepository: DidCommConnectionRepository\n private didRepository: DidRepository\n private eventEmitter: EventEmitter\n private logger: Logger\n\n public constructor(\n @inject(InjectionSymbols.Logger) logger: Logger,\n connectionRepository: DidCommConnectionRepository,\n didRepository: DidRepository,\n eventEmitter: EventEmitter\n ) {\n this.connectionRepository = connectionRepository\n this.didRepository = didRepository\n this.eventEmitter = eventEmitter\n this.logger = logger\n }\n\n /**\n * Create a connection request message for a given out-of-band.\n *\n * @param outOfBandRecord out-of-band record for which to create a connection request\n * @param config config for creation of connection request\n * @returns outbound message containing connection request\n */\n public async createRequest(\n agentContext: AgentContext,\n outOfBandRecord: DidCommOutOfBandRecord,\n config: ConnectionRequestParams\n ): Promise<ConnectionProtocolMsgReturnType<DidCommConnectionRequestMessage>> {\n this.logger.debug(`Create message ${DidCommConnectionRequestMessage.type.messageTypeUri} start`, outOfBandRecord)\n outOfBandRecord.assertRole(DidCommOutOfBandRole.Receiver)\n outOfBandRecord.assertState(DidCommOutOfBandState.PrepareResponse)\n\n // TODO check there is no connection record for particular oob record\n\n const { outOfBandInvitation } = outOfBandRecord\n\n const { mediatorId } = config.routing\n const { didDoc, keys } = this.createDidDoc(config.routing)\n\n // TODO: We should store only one did that we'll use to send the request message with success.\n // We take just the first one for now.\n const [invitationDid] = outOfBandInvitation.invitationDids\n\n const { did: peerDid } = await this.createDid(agentContext, {\n role: DidDocumentRole.Created,\n didDoc,\n keys,\n })\n\n const { label, imageUrl } = config\n\n const connectionRequest = new DidCommConnectionRequestMessage({\n label,\n did: didDoc.id,\n didDoc,\n imageUrl,\n })\n\n connectionRequest.setThread({\n threadId: connectionRequest.threadId,\n parentThreadId: outOfBandRecord.outOfBandInvitation.id,\n })\n\n const connectionRecord = await this.createConnection(agentContext, {\n protocol: DidCommHandshakeProtocol.Connections,\n role: DidCommDidExchangeRole.Requester,\n state: DidCommDidExchangeState.InvitationReceived,\n theirLabel: outOfBandInvitation.label,\n alias: config?.alias,\n did: peerDid,\n mediatorId,\n autoAcceptConnection: config?.autoAcceptConnection,\n outOfBandId: outOfBandRecord.id,\n invitationDid,\n imageUrl: outOfBandInvitation.imageUrl,\n threadId: connectionRequest.threadId,\n })\n\n await this.updateState(agentContext, connectionRecord, DidCommDidExchangeState.RequestSent)\n\n return {\n connectionRecord,\n message: connectionRequest,\n }\n }\n\n public async processRequest(\n messageContext: DidCommInboundMessageContext<DidCommConnectionRequestMessage>,\n outOfBandRecord: DidCommOutOfBandRecord\n ): Promise<DidCommConnectionRecord> {\n this.logger.debug(`Process message ${DidCommConnectionRequestMessage.type.messageTypeUri} start`, {\n message: messageContext.message,\n })\n outOfBandRecord.assertRole(DidCommOutOfBandRole.Sender)\n outOfBandRecord.assertState(DidCommOutOfBandState.AwaitResponse)\n\n // TODO check there is no connection record for particular oob record\n\n const { message } = messageContext\n if (!message.connection.didDoc) {\n throw new ConnectionProblemReportError('Public DIDs are not supported yet', {\n problemCode: ConnectionProblemReportReason.RequestNotAccepted,\n })\n }\n\n const { did: peerDid } = await this.createDid(messageContext.agentContext, {\n role: DidDocumentRole.Received,\n didDoc: message.connection.didDoc,\n })\n\n const connectionRecord = await this.createConnection(messageContext.agentContext, {\n protocol: DidCommHandshakeProtocol.Connections,\n role: DidCommDidExchangeRole.Responder,\n state: DidCommDidExchangeState.RequestReceived,\n alias: outOfBandRecord.alias,\n theirLabel: message.label,\n imageUrl: message.imageUrl,\n outOfBandId: outOfBandRecord.id,\n theirDid: peerDid,\n threadId: message.threadId,\n mediatorId: outOfBandRecord.mediatorId,\n autoAcceptConnection: outOfBandRecord.autoAcceptConnection,\n })\n\n await this.connectionRepository.update(messageContext.agentContext, connectionRecord)\n this.emitStateChangedEvent(messageContext.agentContext, connectionRecord, null)\n\n this.logger.debug(`Process message ${DidCommConnectionRequestMessage.type.messageTypeUri} end`, connectionRecord)\n return connectionRecord\n }\n\n /**\n * Create a connection response message for the connection with the specified connection id.\n *\n * @param connectionRecord the connection for which to create a connection response\n * @returns outbound message containing connection response\n */\n public async createResponse(\n agentContext: AgentContext,\n connectionRecord: DidCommConnectionRecord,\n outOfBandRecord: DidCommOutOfBandRecord,\n routing?: DidCommRouting\n ): Promise<ConnectionProtocolMsgReturnType<DidCommConnectionResponseMessage>> {\n this.logger.debug(`Create message ${DidCommConnectionResponseMessage.type.messageTypeUri} start`, connectionRecord)\n connectionRecord.assertState(DidCommDidExchangeState.RequestReceived)\n connectionRecord.assertRole(DidCommDidExchangeRole.Responder)\n\n let didDoc: DidDoc\n let keys: DidDocumentKey[]\n if (routing) {\n const result = this.createDidDoc(routing)\n didDoc = result.didDoc\n keys = result.keys\n } else if (outOfBandRecord.outOfBandInvitation.getInlineServices().length > 0) {\n const result = this.createDidDocFromOutOfBandDidCommServices(outOfBandRecord)\n didDoc = result.didDoc\n keys = result.keys\n } else {\n // We don't support using a did from the OOB invitation services currently, in this case we always pass routing to this method\n throw new CredoError(\n 'No routing provided, and no inline services found in out of band invitation. When using did services in out of band invitation, make sure to provide routing information for rotation.'\n )\n }\n\n const { did: peerDid } = await this.createDid(agentContext, {\n role: DidDocumentRole.Created,\n didDoc,\n keys,\n })\n\n const connection = new DidCommConnection({\n did: didDoc.id,\n didDoc,\n })\n\n const connectionJson = JsonTransformer.toJSON(connection)\n\n if (!connectionRecord.threadId) {\n throw new CredoError(`Connection record with id ${connectionRecord.id} does not have a thread id`)\n }\n\n let signingKey: Kms.PublicJwk<Kms.Ed25519PublicJwk>\n const firstService = outOfBandRecord.outOfBandInvitation.getServices()[0]\n if (typeof firstService === 'string') {\n const dids = agentContext.resolve(DidsApi)\n const resolved = await dids.resolveCreatedDidDocumentWithKeys(parseDid(firstService).did)\n\n const recipientKeys = resolved.didDocument.getRecipientKeysWithVerificationMethod({ mapX25519ToEd25519: true })\n if (recipientKeys.length === 0) {\n throw new CredoError(`Unable to extract signing key for connection response from did '${firstService}'`)\n }\n\n signingKey = recipientKeys[0].publicJwk\n // TOOD: we probably need an util: addKeyIdToVerificationMethodKey\n signingKey.keyId =\n resolved.keys?.find(({ didDocumentRelativeKeyId }) =>\n recipientKeys[0].verificationMethod.id.endsWith(didDocumentRelativeKeyId)\n )?.kmsKeyId ?? signingKey.legacyKeyId\n } else {\n const service = getResolvedDidcommServiceWithSigningKeyId(\n firstService,\n outOfBandRecord.invitationInlineServiceKeys\n )\n signingKey = service.recipientKeys[0]\n }\n\n const connectionResponse = new DidCommConnectionResponseMessage({\n threadId: connectionRecord.threadId,\n connectionSig: await signData(agentContext, connectionJson, signingKey),\n })\n\n connectionRecord.did = peerDid\n await this.updateState(agentContext, connectionRecord, DidCommDidExchangeState.ResponseSent)\n\n this.logger.debug(`Create message ${DidCommConnectionResponseMessage.type.messageTypeUri} end`, {\n connectionRecord,\n message: connectionResponse,\n })\n return {\n connectionRecord,\n message: connectionResponse,\n }\n }\n\n /**\n * Process a received connection response message. This will not accept the connection request\n * or send a connection acknowledgement message. It will only update the existing connection record\n * with all the new information from the connection response message. Use {@link DidCommConnectionService.createTrustPing}\n * after calling this function to create a trust ping message.\n *\n * @param messageContext the message context containing a connection response message\n * @returns updated connection record\n */\n public async processResponse(\n messageContext: DidCommInboundMessageContext<DidCommConnectionResponseMessage>,\n outOfBandRecord: DidCommOutOfBandRecord\n ): Promise<DidCommConnectionRecord> {\n this.logger.debug(`Process message ${DidCommConnectionResponseMessage.type.messageTypeUri} start`, {\n message: messageContext.message,\n })\n const { connection: connectionRecord, message, recipientKey, senderKey } = messageContext\n\n if (!recipientKey || !senderKey) {\n throw new CredoError('Unable to process connection request without senderKey or recipientKey')\n }\n\n if (!connectionRecord) {\n throw new CredoError('No connection record in message context.')\n }\n\n connectionRecord.assertState(DidCommDidExchangeState.RequestSent)\n connectionRecord.assertRole(DidCommDidExchangeRole.Requester)\n\n let connectionJson = null\n try {\n connectionJson = await unpackAndVerifySignatureDecorator(messageContext.agentContext, message.connectionSig)\n } catch (error) {\n if (error instanceof CredoError) {\n throw new ConnectionProblemReportError(error.message, {\n problemCode: ConnectionProblemReportReason.ResponseProcessingError,\n })\n }\n throw error\n }\n\n const connection = JsonTransformer.fromJSON(connectionJson, DidCommConnection)\n\n // Per the Connection RFC we must check if the key used to sign the connection~sig is the same key\n // as the recipient key(s) in the connection invitation message\n const signerVerkey = message.connectionSig.signer\n\n const invitationKey = Kms.PublicJwk.fromFingerprint(outOfBandRecord.getTags().recipientKeyFingerprints[0])\n if (!invitationKey.is(Kms.Ed25519PublicJwk)) {\n throw new ConnectionProblemReportError(\n `Expected invitation key to be an Ed25519 key, found ${invitationKey.jwkTypehumanDescription}`,\n { problemCode: ConnectionProblemReportReason.ResponseNotAccepted }\n )\n }\n\n const invitationKeyBase58 = TypedArrayEncoder.toBase58(invitationKey.publicKey.publicKey)\n\n if (signerVerkey !== invitationKeyBase58) {\n throw new ConnectionProblemReportError(\n `Connection object in connection response message is not signed with same key as recipient key in invitation expected='${invitationKey}' received='${signerVerkey}'`,\n { problemCode: ConnectionProblemReportReason.ResponseNotAccepted }\n )\n }\n\n if (!connection.didDoc) {\n throw new CredoError('DID Document is missing.')\n }\n\n const { did: peerDid } = await this.createDid(messageContext.agentContext, {\n role: DidDocumentRole.Received,\n didDoc: connection.didDoc,\n })\n\n connectionRecord.theirDid = peerDid\n connectionRecord.threadId = message.threadId\n\n await this.updateState(messageContext.agentContext, connectionRecord, DidCommDidExchangeState.ResponseReceived)\n return connectionRecord\n }\n\n /**\n * Create a trust ping message for the connection with the specified connection id.\n *\n * By default a trust ping message should elicit a response. If this is not desired the\n * `config.responseRequested` property can be set to `false`.\n *\n * @param connectionRecord the connection for which to create a trust ping message\n * @param config the config for the trust ping message\n * @returns outbound message containing trust ping message\n */\n public async createTrustPing(\n agentContext: AgentContext,\n connectionRecord: DidCommConnectionRecord,\n config: { responseRequested?: boolean; comment?: string } = {}\n ): Promise<ConnectionProtocolMsgReturnType<DidCommTrustPingMessage>> {\n connectionRecord.assertState([DidCommDidExchangeState.ResponseReceived, DidCommDidExchangeState.Completed])\n\n // TODO:\n // - create ack message\n // - maybe this shouldn't be in the connection service?\n const trustPing = new DidCommTrustPingMessage(config)\n\n // Only update connection record and emit an event if the state is not already 'Complete'\n if (connectionRecord.state !== DidCommDidExchangeState.Completed) {\n await this.updateState(agentContext, connectionRecord, DidCommDidExchangeState.Completed)\n }\n\n return {\n connectionRecord,\n message: trustPing,\n }\n }\n\n /**\n * Process a received ack message. This will update the state of the connection\n * to Completed if this is not already the case.\n *\n * @param messageContext the message context containing an ack message\n * @returns updated connection record\n */\n public async processAck(\n messageContext: DidCommInboundMessageContext<DidCommAckMessage>\n ): Promise<DidCommConnectionRecord> {\n const { connection, recipientKey } = messageContext\n\n if (!connection) {\n throw new CredoError(\n `Unable to process connection ack: connection for recipient key ${recipientKey?.fingerprint} not found`\n )\n }\n\n // TODO: This is better addressed in a middleware of some kind because\n // any message can transition the state to complete, not just an ack or trust ping\n if (\n connection.state === DidCommDidExchangeState.ResponseSent &&\n connection.role === DidCommDidExchangeRole.Responder\n ) {\n await this.updateState(messageContext.agentContext, connection, DidCommDidExchangeState.Completed)\n }\n\n return connection\n }\n\n /**\n * Process a received {@link DidCommProblemReportMessage}.\n *\n * @param messageContext The message context containing a connection problem report message\n * @returns connection record associated with the connection problem report message\n *\n */\n public async processProblemReport(\n messageContext: DidCommInboundMessageContext<DidCommConnectionProblemReportMessage>\n ): Promise<DidCommConnectionRecord> {\n const { message: connectionProblemReportMessage, recipientKey, senderKey } = messageContext\n\n this.logger.debug(`Processing connection problem report for verkey ${recipientKey?.fingerprint}`)\n\n if (!recipientKey) {\n throw new CredoError('Unable to process connection problem report without recipientKey')\n }\n\n const ourDidRecord = await this.didRepository.findCreatedDidByRecipientKey(\n messageContext.agentContext,\n recipientKey\n )\n if (!ourDidRecord) {\n throw new CredoError(\n `Unable to process connection problem report: created did record for recipient key ${recipientKey.fingerprint} not found`\n )\n }\n\n const connectionRecord = await this.findByOurDid(messageContext.agentContext, ourDidRecord.did)\n if (!connectionRecord) {\n throw new CredoError(\n `Unable to process connection problem report: connection for recipient key ${recipientKey.fingerprint} not found`\n )\n }\n\n const theirDidRecord =\n connectionRecord.theirDid &&\n (await this.didRepository.findReceivedDid(messageContext.agentContext, connectionRecord.theirDid))\n if (!theirDidRecord) {\n throw new CredoError(`Received did record for did ${connectionRecord.theirDid} not found.`)\n }\n\n if (senderKey) {\n if (!theirDidRecord?.getTags().recipientKeyFingerprints?.includes(senderKey.fingerprint)) {\n throw new CredoError(\"Sender key doesn't match key of connection record\")\n }\n }\n\n connectionRecord.errorMessage = `${connectionProblemReportMessage.description.code} : ${connectionProblemReportMessage.description.en}`\n await this.update(messageContext.agentContext, connectionRecord)\n\n // Marking connection as abandoned in case of problem report from issuer agent\n // TODO: Can be conditionally abandoned - Like if another user is scanning already used connection invite where issuer will send invite-already-used problem code.\n await this.updateState(messageContext.agentContext, connectionRecord, DidCommDidExchangeState.Abandoned)\n\n return connectionRecord\n }\n\n /**\n * Assert that an inbound message either has a connection associated with it,\n * or has everything correctly set up for connection-less exchange (optionally with out of band)\n *\n * @param messageContext - the inbound message context\n */\n public async assertConnectionOrOutOfBandExchange(\n messageContext: DidCommInboundMessageContext,\n {\n lastSentMessage,\n lastReceivedMessage,\n expectedConnectionId,\n }: {\n lastSentMessage?: DidCommMessage | null\n lastReceivedMessage?: DidCommMessage | null\n expectedConnectionId?: string\n } = {}\n ) {\n const { connection, message } = messageContext\n\n if (expectedConnectionId && !connection) {\n throw new CredoError(\n `Expected incoming message to be from connection ${expectedConnectionId} but no connection found.`\n )\n }\n if (expectedConnectionId && connection?.id !== expectedConnectionId) {\n throw new CredoError(\n `Expected incoming message to be from connection ${expectedConnectionId} but connection is ${connection?.id}.`\n )\n }\n\n // Check if we have a ready connection. Verification is already done somewhere else. Return\n if (connection) {\n connection.assertReady()\n this.logger.debug(`Processing message with id ${message.id} and connection id ${connection.id}`, {\n type: message.type,\n })\n } else {\n this.logger.debug(`Processing connection-less message with id ${message.id}`, {\n type: message.type,\n })\n\n const recipientKey = messageContext.recipientKey\n const senderKey = messageContext.senderKey\n\n // set theirService to the value of lastReceivedMessage.service\n let theirService =\n messageContext.message?.service?.resolvedDidCommService ?? lastReceivedMessage?.service?.resolvedDidCommService\n let ourService = lastSentMessage?.service?.resolvedDidCommService\n\n // FIXME: we should remove support for the flow where no out of band record is used.\n // Users have had enough time to update to the OOB API which supports legacy connectionsless\n // invitations as well\n // 1. check if there's an oob record associated.\n const outOfBandRepository = messageContext.agentContext.dependencyManager.resolve(DidCommOutOfBandRepository)\n const outOfBandService = messageContext.agentContext.dependencyManager.resolve(DidCommOutOfBandService)\n const outOfBandRecord = await outOfBandRepository.findSingleByQuery(messageContext.agentContext, {\n invitationRequestsThreadIds: [message.threadId],\n })\n\n // If we have an out of band record, we can extract the service for our/the other party from the oob record\n if (outOfBandRecord?.role === DidCommOutOfBandRole.Sender) {\n ourService = await outOfBandService.getResolvedServiceForOutOfBandServices(\n messageContext.agentContext,\n outOfBandRecord.outOfBandInvitation.getServices(),\n outOfBandRecord.invitationInlineServiceKeys\n )\n } else if (outOfBandRecord?.role === DidCommOutOfBandRole.Receiver) {\n theirService = await outOfBandService.getResolvedServiceForOutOfBandServices(\n messageContext.agentContext,\n outOfBandRecord.outOfBandInvitation.getServices()\n )\n }\n\n // theirService can be null when we receive an oob invitation and process the message.\n // In this case there MUST be an oob record, otherwise there is no way for us to reply\n // to the message\n if (!theirService && !outOfBandRecord) {\n throw new CredoError(\n 'No service for incoming connection-less message and no associated out of band record found.'\n )\n }\n\n // ourService can be null when we receive an oob invitation or legacy connectionless message and process the message.\n // In this case lastSentMessage and lastReceivedMessage MUST be null, because there shouldn't be any previous exchange\n if (!ourService && (lastReceivedMessage || lastSentMessage)) {\n throw new CredoError(\n 'No keys on our side to use for encrypting messages, and previous messages found (in which case our keys MUST also be present).'\n )\n }\n\n // If the message is unpacked or AuthCrypt, there cannot be any previous exchange (this must be the first message).\n // All exchange after the first unpacked oob exchange MUST be encrypted.\n if ((!senderKey || !recipientKey) && (lastSentMessage || lastReceivedMessage)) {\n throw new CredoError(\n 'Incoming message must have recipientKey and senderKey (so cannot be AuthCrypt or unpacked) if there are lastSentMessage or lastReceivedMessage.'\n )\n }\n\n // Check if recipientKey is in ourService\n if (recipientKey && ourService) {\n const recipientKeyFound = ourService.recipientKeys.some((key) => recipientKey.equals(key))\n if (!recipientKeyFound) {\n throw new CredoError(`Recipient key ${recipientKey.fingerprint} not found in our service`)\n }\n }\n\n // Check if senderKey is in theirService\n if (senderKey && theirService) {\n const senderKeyFound = theirService.recipientKeys.some((key) => senderKey.equals(key))\n if (!senderKeyFound) {\n throw new CredoError(`Sender key ${senderKey.fingerprint} not found in their service.`)\n }\n }\n }\n }\n\n /**\n * If knownConnectionId is passed, it will compare the incoming connection id with the knownConnectionId, and skip the other validation.\n *\n * If no known connection id is passed, it asserts that the incoming message is in response to an attached request message to an out of band invitation.\n * If is the case, and the state of the out of band record is still await response, the state will be updated to done\n *\n */\n public async matchIncomingMessageToRequestMessageInOutOfBandExchange(\n messageContext: DidCommInboundMessageContext,\n { expectedConnectionId }: { expectedConnectionId?: string }\n ) {\n if (expectedConnectionId && messageContext.connection?.id !== expectedConnectionId) {\n throw new CredoError(\n `Expecting incoming message to have connection ${expectedConnectionId}, but incoming connection is ${\n messageContext.connection?.id ?? 'undefined'\n }`\n )\n }\n\n const outOfBandRepository = messageContext.agentContext.dependencyManager.resolve(DidCommOutOfBandRepository)\n const outOfBandInvitationId = messageContext.message.thread?.parentThreadId\n\n // Find the out of band record that is associated with this request\n const outOfBandRecord = await outOfBandRepository.findSingleByQuery(messageContext.agentContext, {\n invitationId: outOfBandInvitationId,\n role: DidCommOutOfBandRole.Sender,\n invitationRequestsThreadIds: [messageContext.message.threadId],\n })\n\n // There is no out of band record\n if (!outOfBandRecord) {\n throw new CredoError(\n `No out of band record found for credential request message with thread ${messageContext.message.threadId}, out of band invitation id ${outOfBandInvitationId} and role ${DidCommOutOfBandRole.Sender}`\n )\n }\n\n const legacyInvitationMetadata = outOfBandRecord.metadata.get(DidCommOutOfBandRecordMetadataKeys.LegacyInvitation)\n\n // If the original invitation was a legacy connectionless invitation, it's okay if the message does not have a pthid.\n if (\n legacyInvitationMetadata?.legacyInvitationType !== DidCommInvitationType.Connectionless &&\n outOfBandRecord.outOfBandInvitation.id !== outOfBandInvitationId\n ) {\n throw new CredoError(\n 'Response messages to out of band invitation requests MUST have a parent thread id that matches the out of band invitation id.'\n )\n }\n\n // This should not happen, as it is not allowed to create reusable out of band invitations with attached messages\n // But should that implementation change, we at least cover it here.\n if (outOfBandRecord.reusable) {\n throw new CredoError('Receiving messages in response to reusable out of band invitations is not supported.')\n }\n\n if (outOfBandRecord.state === DidCommOutOfBandState.Done) {\n if (!messageContext.connection) {\n throw new CredoError(\n \"Can't find connection associated with incoming message, while out of band state is done. State must be await response if no connection has been created\"\n )\n }\n if (messageContext.connection.outOfBandId !== outOfBandRecord.id) {\n throw new CredoError(\n 'Connection associated with incoming message is not associated with the out of band invitation containing the attached message.'\n )\n }\n\n // We're good to go. Connection was created and points to the correct out of band record. And the message is in response to an attached request message from the oob invitation.\n } else if (outOfBandRecord.state === DidCommOutOfBandState.AwaitResponse) {\n // We're good to go. Waiting for a response. And the message is in response to an attached request message from the oob invitation.\n\n // Now that we have received the first response message to our out of band invitation, we mark the out of band record as done\n outOfBandRecord.state = DidCommOutOfBandState.Done\n await outOfBandRepository.update(messageContext.agentContext, outOfBandRecord)\n } else {\n throw new CredoError(`Out of band record is in incorrect state ${outOfBandRecord.state}`)\n }\n }\n\n public async updateState(\n agentContext: AgentContext,\n connectionRecord: DidCommConnectionRecord,\n newState: DidCommDidExchangeState\n ) {\n const previousState = connectionRecord.state\n connectionRecord.state = newState\n await this.connectionRepository.update(agentContext, connectionRecord)\n\n this.emitStateChangedEvent(agentContext, connectionRecord, previousState)\n }\n\n private emitStateChangedEvent(\n agentContext: AgentContext,\n connectionRecord: DidCommConnectionRecord,\n previousState: DidCommDidExchangeState | null\n ) {\n this.eventEmitter.emit<DidCommConnectionStateChangedEvent>(agentContext, {\n type: DidCommConnectionEventTypes.DidCommConnectionStateChanged,\n payload: {\n // Connection record in event should be static\n connectionRecord: connectionRecord.clone(),\n previousState,\n },\n })\n }\n\n public update(agentContext: AgentContext, connectionRecord: DidCommConnectionRecord) {\n return this.connectionRepository.update(agentContext, connectionRecord)\n }\n\n /**\n * Retrieve all connections records\n *\n * @returns List containing all connection records\n */\n public getAll(agentContext: AgentContext) {\n return this.connectionRepository.getAll(agentContext)\n }\n\n /**\n * Retrieve a connection record by id\n *\n * @param connectionId The connection record id\n * @throws {RecordNotFoundError} If no record is found\n * @return The connection record\n *\n */\n public getById(agentContext: AgentContext, connectionId: string): Promise<DidCommConnectionRecord> {\n return this.connectionRepository.getById(agentContext, connectionId)\n }\n\n /**\n * Find a connection record by id\n *\n * @param connectionId the connection record id\n * @returns The connection record or null if not found\n */\n public findById(agentContext: AgentContext, connectionId: string): Promise<DidCommConnectionRecord | null> {\n return this.connectionRepository.findById(agentContext, connectionId)\n }\n\n /**\n * Delete a connection record by id\n *\n * @param connectionId the connection record id\n */\n public async deleteById(agentContext: AgentContext, connectionId: string) {\n const connectionRecord = await this.getById(agentContext, connectionId)\n return this.connectionRepository.delete(agentContext, connectionRecord)\n }\n\n public async findByDids(agentContext: AgentContext, query: { ourDid: string; theirDid: string }) {\n return this.connectionRepository.findByDids(agentContext, query)\n }\n\n /**\n * Retrieve a connection record by thread id\n *\n * @param threadId The thread id\n * @throws {RecordNotFoundError} If no record is found\n * @throws {RecordDuplicateError} If multiple records are found\n * @returns The connection record\n */\n public async getByThreadId(agentContext: AgentContext, threadId: string): Promise<DidCommConnectionRecord> {\n return this.connectionRepository.getByThreadId(agentContext, threadId)\n }\n\n public async getByRoleAndThreadId(agentContext: AgentContext, role: DidCommDidExchangeRole, threadId: string) {\n return this.connectionRepository.getByRoleAndThreadId(agentContext, role, threadId)\n }\n\n public async findByTheirDid(agentContext: AgentContext, theirDid: string): Promise<DidCommConnectionRecord | null> {\n return this.connectionRepository.findSingleByQuery(agentContext, { theirDid })\n }\n\n public async findByOurDid(agentContext: AgentContext, ourDid: string): Promise<DidCommConnectionRecord | null> {\n return this.connectionRepository.findSingleByQuery(agentContext, { did: ourDid })\n }\n\n public async findAllByOutOfBandId(agentContext: AgentContext, outOfBandId: string) {\n return this.connectionRepository.findByQuery(agentContext, { outOfBandId })\n }\n\n public async findAllByConnectionTypes(\n agentContext: AgentContext,\n connectionTypes: Array<DidCommConnectionType | string>\n ) {\n return this.connectionRepository.findByQuery(agentContext, { connectionTypes })\n }\n\n public async findByInvitationDid(agentContext: AgentContext, invitationDid: string) {\n return this.connectionRepository.findByQuery(agentContext, { invitationDid })\n }\n\n public async findByKeys(\n agentContext: AgentContext,\n {\n senderKey,\n recipientKey,\n }: { senderKey: Kms.PublicJwk<Kms.Ed25519PublicJwk>; recipientKey: Kms.PublicJwk<Kms.Ed25519PublicJwk> }\n ) {\n const theirDidRecord = await this.didRepository.findReceivedDidByRecipientKey(agentContext, senderKey)\n if (theirDidRecord) {\n const ourDidRecord = await this.didRepository.findCreatedDidByRecipientKey(agentContext, recipientKey)\n if (ourDidRecord) {\n const connectionRecord = await this.findByDids(agentContext, {\n ourDid: ourDidRecord.did,\n theirDid: theirDidRecord.did,\n })\n if (connectionRecord?.isReady) return connectionRecord\n }\n }\n\n this.logger.debug(\n `No connection record found for encrypted message with recipient key ${recipientKey.fingerprint} and sender key ${senderKey.fingerprint}`\n )\n\n return null\n }\n\n public async findAllByQuery(\n agentContext: AgentContext,\n query: Query<DidCommConnectionRecord>,\n queryOptions?: QueryOptions\n ): Promise<DidCommConnectionRecord[]> {\n return this.connectionRepository.findByQuery(agentContext, query, queryOptions)\n }\n\n public async createConnection(\n agentContext: AgentContext,\n options: DidCommConnectionRecordProps\n ): Promise<DidCommConnectionRecord> {\n const connectionRecord = new DidCommConnectionRecord(options)\n await this.connectionRepository.save(agentContext, connectionRecord)\n return connectionRecord\n }\n\n public async addConnectionType(agentContext: AgentContext, connectionRecord: DidCommConnectionRecord, type: string) {\n const connectionTypes = connectionRecord.connectionTypes || []\n connectionRecord.connectionTypes = [type, ...connectionTypes]\n await this.update(agentContext, connectionRecord)\n }\n\n public async removeConnectionType(\n agentContext: AgentContext,\n connectionRecord: DidCommConnectionRecord,\n type: string\n ) {\n connectionRecord.connectionTypes = connectionRecord.connectionTypes.filter((value) => value !== type)\n await this.update(agentContext, connectionRecord)\n }\n\n public async getConnectionTypes(connectionRecord: DidCommConnectionRecord) {\n return connectionRecord.connectionTypes || []\n }\n\n private async createDid(\n agentContext: AgentContext,\n { role, didDoc, keys }: { role: DidDocumentRole; didDoc: DidDoc; keys?: DidDocumentKey[] }\n ) {\n if (keys && role !== DidDocumentRole.Created) {\n throw new CredoError(`keys can only be provided for did documents when the role is '${DidDocumentRole.Created}'`)\n }\n\n // Convert the legacy did doc to a new did document\n const { didDocument, keys: updatedKeys } = convertToNewDidDocument(didDoc, keys)\n\n // Assert that the keys we are going to use for creating a did document haven't already been used in another did document\n if (role === DidDocumentRole.Created) {\n await assertNoCreatedDidExistsForKeys(agentContext, didDocument.recipientKeys)\n }\n\n const peerDid = didDocumentJsonToNumAlgo1Did(didDocument.toJSON())\n didDocument.id = peerDid\n const didRecord = new DidRecord({\n did: peerDid,\n role,\n didDocument,\n keys: updatedKeys,\n })\n\n // Store the unqualified did with the legacy did document in the metadata\n // Can be removed at a later stage if we know for sure we don't need it anymore\n didRecord.metadata.set(DidRecordMetadataKeys.LegacyDid, {\n unqualifiedDid: didDoc.id,\n didDocumentString: JsonTransformer.serialize(didDoc),\n })\n\n this.logger.debug('Saving DID record', {\n id: didRecord.id,\n did: didRecord.did,\n role: didRecord.role,\n tags: didRecord.getTags(),\n didDocument: 'omitted...',\n })\n\n await this.didRepository.save(agentContext, didRecord)\n this.logger.debug('Did record created.', didRecord)\n return { did: peerDid, didDocument }\n }\n\n private createDidDoc(routing: DidCommRouting) {\n const recipientKeyBase58 = TypedArrayEncoder.toBase58(routing.recipientKey.publicKey.publicKey)\n const indyDid = utils.indyDidFromPublicKeyBase58(recipientKeyBase58)\n\n const keys: DidDocumentKey[] = [\n {\n didDocumentRelativeKeyId: '#1',\n kmsKeyId: routing.recipientKey.keyId,\n },\n ]\n\n const publicKey = new Ed25119Sig2018({\n id: `${indyDid}#1`,\n controller: indyDid,\n publicKeyBase58: recipientKeyBase58,\n })\n\n const auth = new ReferencedAuthentication(publicKey, authenticationTypes.Ed25519VerificationKey2018)\n\n // IndyAgentService is old service type\n const services = routing.endpoints.map(\n (endpoint, index) =>\n new IndyAgentService({\n id: `${indyDid}#IndyAgentService-${index + 1}`,\n serviceEndpoint: endpoint,\n recipientKeys: [recipientKeyBase58],\n routingKeys: routing.routingKeys.map((key) => TypedArrayEncoder.toBase58(key.publicKey.publicKey)),\n // Order of endpoint determines priority\n priority: index,\n })\n )\n\n return {\n didDoc: new DidDoc({\n id: indyDid,\n authentication: [auth],\n service: services,\n publicKey: [publicKey],\n }),\n keys,\n }\n }\n\n private createDidDocFromOutOfBandDidCommServices(outOfBandRecord: DidCommOutOfBandRecord) {\n const services = outOfBandRecord.outOfBandInvitation\n .getInlineServices()\n .map((service) => getResolvedDidcommServiceWithSigningKeyId(service, outOfBandRecord.invitationInlineServiceKeys))\n\n const [recipientKey] = services[0].recipientKeys\n const recipientKeyBase58 = TypedArrayEncoder.toBase58(recipientKey.publicKey.publicKey)\n const did = utils.indyDidFromPublicKeyBase58(recipientKeyBase58)\n\n const publicKey = new Ed25119Sig2018({\n id: `${did}#1`,\n controller: did,\n publicKeyBase58: recipientKeyBase58,\n })\n\n const auth = new ReferencedAuthentication(publicKey, authenticationTypes.Ed25519VerificationKey2018)\n\n // IndyAgentService is old service type\n const service = services.map(\n (service, index) =>\n new IndyAgentService({\n id: `${did}#IndyAgentService-${index + 1}`,\n serviceEndpoint: service.serviceEndpoint,\n recipientKeys: [recipientKeyBase58],\n routingKeys: service.routingKeys?.map((publicJwk) =>\n TypedArrayEncoder.toBase58(publicJwk.publicKey.publicKey)\n ),\n priority: index,\n })\n )\n\n return {\n didDoc: new DidDoc({\n id: did,\n authentication: [auth],\n service,\n publicKey: [publicKey],\n }),\n keys: [{ didDocumentRelativeKeyId: '#1', kmsKeyId: recipientKey.keyId }] satisfies DidDocumentKey[],\n }\n }\n\n public async returnWhenIsConnected(\n agentContext: AgentContext,\n connectionId: string,\n timeoutMs = 20000\n ): Promise<DidCommConnectionRecord> {\n const isConnected = (connection: DidCommConnectionRecord) => {\n return connection.id === connectionId && connection.state === DidCommDidExchangeState.Completed\n }\n\n const observable = this.eventEmitter.observable<DidCommConnectionStateChangedEvent>(\n DidCommConnectionEventTypes.DidCommConnectionStateChanged\n )\n const subject = new ReplaySubject<DidCommConnectionRecord>(1)\n\n observable\n .pipe(\n filterContextCorrelationId(agentContext.contextCorrelationId),\n map((e) => e.payload.connectionRecord),\n first(isConnected), // Do not wait for longer than specified timeout\n timeout({\n first: timeoutMs,\n meta: 'DidCommConnectionService.returnWhenIsConnected',\n })\n )\n .subscribe(subject)\n\n const connection = await this.getById(agentContext, connectionId)\n if (isConnected(connection)) {\n subject.next(connection)\n }\n\n return firstValueFrom(subject)\n }\n}\n\nexport interface ConnectionProtocolMsgReturnType<MessageType extends DidCommMessage> {\n message: MessageType\n connectionRecord: DidCommConnectionRecord\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuEO,qCAAMA,2BAAyB;CAMpC,AAAO,YACL,AAAiCC,QACjC,sBACA,eACA,cACA;AACA,OAAK,uBAAuB;AAC5B,OAAK,gBAAgB;AACrB,OAAK,eAAe;AACpB,OAAK,SAAS;;;;;;;;;CAUhB,MAAa,cACX,cACA,iBACA,QAC2E;AAC3E,OAAK,OAAO,MAAM,kBAAkB,gCAAgC,KAAK,eAAe,SAAS,gBAAgB;AACjH,kBAAgB,WAAW,qBAAqB,SAAS;AACzD,kBAAgB,YAAY,sBAAsB,gBAAgB;EAIlE,MAAM,EAAE,wBAAwB;EAEhC,MAAM,EAAE,eAAe,OAAO;EAC9B,MAAM,EAAE,QAAQ,SAAS,KAAK,aAAa,OAAO,QAAQ;EAI1D,MAAM,CAAC,iBAAiB,oBAAoB;EAE5C,MAAM,EAAE,KAAK,YAAY,MAAM,KAAK,UAAU,cAAc;GAC1D,MAAM,gBAAgB;GACtB;GACA;GACD,CAAC;EAEF,MAAM,EAAE,OAAO,aAAa;EAE5B,MAAM,oBAAoB,IAAI,gCAAgC;GAC5D;GACA,KAAK,OAAO;GACZ;GACA;GACD,CAAC;AAEF,oBAAkB,UAAU;GAC1B,UAAU,kBAAkB;GAC5B,gBAAgB,gBAAgB,oBAAoB;GACrD,CAAC;EAEF,MAAM,mBAAmB,MAAM,KAAK,iBAAiB,cAAc;GACjE,UAAU,yBAAyB;GACnC,MAAM,uBAAuB;GAC7B,OAAO,wBAAwB;GAC/B,YAAY,oBAAoB;GAChC,OAAO,Q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AI,GAAG,IAAI;GACX,YAAY;GACZ,iBAAiB;GAClB,CAAC;EAEF,MAAM,OAAO,IAAI,yBAAyB,WAAW,oBAAoB,2BAA2B;EAGpG,MAAM,UAAU,SAAS,KACtB,WAAS,UACR,IAAI,iBAAiB;GACnB,IAAI,GAAG,IAAI,oBAAoB,QAAQ;GACvC,iBAAiBA,UAAQ;GACzB,eAAe,CAAC,mBAAmB;GACnC,aAAaA,UAAQ,aAAa,KAAK,cACrC,kBAAkB,SAAS,UAAU,UAAU,UAAU,CAC1D;GACD,UAAU;GACX,CAAC,CACL;AAED,SAAO;GACL,QAAQ,IAAI,OAAO;IACjB,IAAI;IACJ,gBAAgB,CAAC,KAAK;IACtB;IACA,WAAW,CAAC,UAAU;IACvB,CAAC;GACF,MAAM,CAAC;IAAE,0BAA0B;IAAM,UAAU,aAAa;IAAO,CAAC;GACzE;;CAGH,MAAa,sBACX,cACA,cACA,YAAY,KACsB;EAClC,MAAM,eAAe,iBAAwC;AAC3D,UAAOC,aAAW,OAAO,gBAAgBA,aAAW,UAAU,wBAAwB;;EAGxF,MAAM,aAAa,KAAK,aAAa,WACnC,4BAA4B,8BAC7B;EACD,MAAM,UAAU,IAAI,cAAuC,EAAE;AAE7D,aACG,KACC,2BAA2B,aAAa,qBAAqB,EAC7DC,OAAK,MAAM,EAAE,QAAQ,iBAAiB,EACtCC,QAAM,YAAY,EAClBC,UAAQ;GACN,OAAO;GACP,MAAM;GACP,CAAC,CACH,CACA,UAAU,QAAQ;EAErB,MAAM,aAAa,MAAM,KAAK,QAAQ,cAAc,aAAa;AACjE,MAAI,YAAY,WAAW,CACzB,SAAQ,KAAK,WAAW;AAG1B,SAAO,eAAe,QAAQ;;;;CAj8BjC,YAAY;oBAQR,OAAO,iBAAiB,OAAO"}
|
|
1
|
+
{"version":3,"file":"DidCommConnectionService.mjs","names":["DidCommConnectionService","logger: Logger","didDoc: DidDoc","keys: DidDocumentKey[]","signingKey: Kms.PublicJwk<Kms.Ed25519PublicJwk>","service","connection","map","first","timeout"],"sources":["../../../../src/modules/connections/services/DidCommConnectionService.ts"],"sourcesContent":["import type { AgentContext, DidDocumentKey, Query, QueryOptions } from '@credo-ts/core'\nimport {\n CredoError,\n DidDocumentRole,\n DidRecord,\n DidRecordMetadataKeys,\n DidRepository,\n DidsApi,\n didDocumentJsonToNumAlgo1Did,\n EventEmitter,\n filterContextCorrelationId,\n IndyAgentService,\n InjectionSymbols,\n inject,\n injectable,\n JsonTransformer,\n Kms,\n type Logger,\n parseDid,\n TypedArrayEncoder,\n utils,\n} from '@credo-ts/core'\nimport { firstValueFrom, ReplaySubject } from 'rxjs'\nimport { first, map, timeout } from 'rxjs/operators'\nimport type { DidCommMessage } from '../../../DidCommMessage'\nimport { signData, unpackAndVerifySignatureDecorator } from '../../../decorators/signature/SignatureDecoratorUtils'\nimport type { DidCommAckMessage } from '../../../messages'\nimport type { DidCommInboundMessageContext, DidCommRouting } from '../../../models'\nimport { DidCommOutOfBandService } from '../../oob/DidCommOutOfBandService'\nimport { DidCommOutOfBandRole } from '../../oob/domain/DidCommOutOfBandRole'\nimport { DidCommOutOfBandState } from '../../oob/domain/DidCommOutOfBandState'\nimport { DidCommInvitationType } from '../../oob/messages'\nimport type { DidCommOutOfBandRecord } from '../../oob/repository'\nimport { DidCommOutOfBandRepository } from '../../oob/repository'\nimport { DidCommOutOfBandRecordMetadataKeys } from '../../oob/repository/outOfBandRecordMetadataTypes'\nimport type { DidCommConnectionStateChangedEvent } from '../DidCommConnectionEvents'\nimport { DidCommConnectionEventTypes } from '../DidCommConnectionEvents'\nimport { ConnectionProblemReportError, ConnectionProblemReportReason } from '../errors'\nimport type { DidCommConnectionProblemReportMessage } from '../messages'\nimport { DidCommConnectionRequestMessage, DidCommConnectionResponseMessage, DidCommTrustPingMessage } from '../messages'\nimport type { DidCommConnectionType } from '../models'\nimport {\n authenticationTypes,\n DidCommConnection,\n DidCommDidExchangeRole,\n DidCommDidExchangeState,\n DidCommHandshakeProtocol,\n DidDoc,\n Ed25119Sig2018,\n ReferencedAuthentication,\n} from '../models'\nimport type { DidCommConnectionRecordProps } from '../repository'\nimport { DidCommConnectionRecord, DidCommConnectionRepository } from '../repository'\n\nimport {\n assertNoCreatedDidExistsForKeys,\n convertToNewDidDocument,\n getResolvedDidcommServiceWithSigningKeyId,\n} from './helpers'\n\nexport interface ConnectionRequestParams {\n label: string\n imageUrl?: string\n alias?: string\n routing: DidCommRouting\n autoAcceptConnection?: boolean\n}\n\n@injectable()\nexport class DidCommConnectionService {\n private connectionRepository: DidCommConnectionRepository\n private didRepository: DidRepository\n private eventEmitter: EventEmitter\n private logger: Logger\n\n public constructor(\n @inject(InjectionSymbols.Logger) logger: Logger,\n connectionRepository: DidCommConnectionRepository,\n didRepository: DidRepository,\n eventEmitter: EventEmitter\n ) {\n this.connectionRepository = connectionRepository\n this.didRepository = didRepository\n this.eventEmitter = eventEmitter\n this.logger = logger\n }\n\n /**\n * Create a connection request message for a given out-of-band.\n *\n * @param outOfBandRecord out-of-band record for which to create a connection request\n * @param config config for creation of connection request\n * @returns outbound message containing connection request\n */\n public async createRequest(\n agentContext: AgentContext,\n outOfBandRecord: DidCommOutOfBandRecord,\n config: ConnectionRequestParams\n ): Promise<ConnectionProtocolMsgReturnType<DidCommConnectionRequestMessage>> {\n this.logger.debug(`Create message ${DidCommConnectionRequestMessage.type.messageTypeUri} start`, outOfBandRecord)\n outOfBandRecord.assertRole(DidCommOutOfBandRole.Receiver)\n outOfBandRecord.assertState(DidCommOutOfBandState.PrepareResponse)\n\n // TODO check there is no connection record for particular oob record\n\n const { outOfBandInvitation } = outOfBandRecord\n\n const { mediatorId } = config.routing\n const { didDoc, keys } = this.createDidDoc(config.routing)\n\n // TODO: We should store only one did that we'll use to send the request message with success.\n // We take just the first one for now.\n const [invitationDid] = outOfBandInvitation.invitationDids\n\n const { did: peerDid } = await this.createDid(agentContext, {\n role: DidDocumentRole.Created,\n didDoc,\n keys,\n })\n\n const { label, imageUrl } = config\n\n const connectionRequest = new DidCommConnectionRequestMessage({\n label,\n did: didDoc.id,\n didDoc,\n imageUrl,\n })\n\n connectionRequest.setThread({\n threadId: connectionRequest.threadId,\n parentThreadId: outOfBandRecord.outOfBandInvitation.id,\n })\n\n const connectionRecord = await this.createConnection(agentContext, {\n protocol: DidCommHandshakeProtocol.Connections,\n role: DidCommDidExchangeRole.Requester,\n state: DidCommDidExchangeState.InvitationReceived,\n theirLabel: outOfBandInvitation.label,\n alias: config?.alias,\n did: peerDid,\n mediatorId,\n autoAcceptConnection: config?.autoAcceptConnection,\n outOfBandId: outOfBandRecord.id,\n invitationDid,\n imageUrl: outOfBandInvitation.imageUrl,\n threadId: connectionRequest.threadId,\n })\n\n await this.updateState(agentContext, connectionRecord, DidCommDidExchangeState.RequestSent)\n\n return {\n connectionRecord,\n message: connectionRequest,\n }\n }\n\n public async processRequest(\n messageContext: DidCommInboundMessageContext<DidCommConnectionRequestMessage>,\n outOfBandRecord: DidCommOutOfBandRecord\n ): Promise<DidCommConnectionRecord> {\n this.logger.debug(`Process message ${DidCommConnectionRequestMessage.type.messageTypeUri} start`, {\n message: messageContext.message,\n })\n outOfBandRecord.assertRole(DidCommOutOfBandRole.Sender)\n outOfBandRecord.assertState(DidCommOutOfBandState.AwaitResponse)\n\n // TODO check there is no connection record for particular oob record\n\n const { message } = messageContext\n if (!message.connection.didDoc) {\n throw new ConnectionProblemReportError('Public DIDs are not supported yet', {\n problemCode: ConnectionProblemReportReason.RequestNotAccepted,\n })\n }\n\n const { did: peerDid } = await this.createDid(messageContext.agentContext, {\n role: DidDocumentRole.Received,\n didDoc: message.connection.didDoc,\n })\n\n const connectionRecord = await this.createConnection(messageContext.agentContext, {\n protocol: DidCommHandshakeProtocol.Connections,\n role: DidCommDidExchangeRole.Responder,\n state: DidCommDidExchangeState.RequestReceived,\n alias: outOfBandRecord.alias,\n theirLabel: message.label,\n imageUrl: message.imageUrl,\n outOfBandId: outOfBandRecord.id,\n theirDid: peerDid,\n threadId: message.threadId,\n mediatorId: outOfBandRecord.mediatorId,\n autoAcceptConnection: outOfBandRecord.autoAcceptConnection,\n })\n\n await this.connectionRepository.update(messageContext.agentContext, connectionRecord)\n this.emitStateChangedEvent(messageContext.agentContext, connectionRecord, null)\n\n this.logger.debug(`Process message ${DidCommConnectionRequestMessage.type.messageTypeUri} end`, connectionRecord)\n return connectionRecord\n }\n\n /**\n * Create a connection response message for the connection with the specified connection id.\n *\n * @param connectionRecord the connection for which to create a connection response\n * @returns outbound message containing connection response\n */\n public async createResponse(\n agentContext: AgentContext,\n connectionRecord: DidCommConnectionRecord,\n outOfBandRecord: DidCommOutOfBandRecord,\n routing?: DidCommRouting\n ): Promise<ConnectionProtocolMsgReturnType<DidCommConnectionResponseMessage>> {\n this.logger.debug(`Create message ${DidCommConnectionResponseMessage.type.messageTypeUri} start`, connectionRecord)\n connectionRecord.assertState(DidCommDidExchangeState.RequestReceived)\n connectionRecord.assertRole(DidCommDidExchangeRole.Responder)\n\n let didDoc: DidDoc\n let keys: DidDocumentKey[]\n if (routing) {\n const result = this.createDidDoc(routing)\n didDoc = result.didDoc\n keys = result.keys\n } else if (outOfBandRecord.outOfBandInvitation.getInlineServices().length > 0) {\n const result = this.createDidDocFromOutOfBandDidCommServices(outOfBandRecord)\n didDoc = result.didDoc\n keys = result.keys\n } else {\n // We don't support using a did from the OOB invitation services currently, in this case we always pass routing to this method\n throw new CredoError(\n 'No routing provided, and no inline services found in out of band invitation. When using did services in out of band invitation, make sure to provide routing information for rotation.'\n )\n }\n\n const { did: peerDid } = await this.createDid(agentContext, {\n role: DidDocumentRole.Created,\n didDoc,\n keys,\n })\n\n const connection = new DidCommConnection({\n did: didDoc.id,\n didDoc,\n })\n\n const connectionJson = JsonTransformer.toJSON(connection)\n\n if (!connectionRecord.threadId) {\n throw new CredoError(`Connection record with id ${connectionRecord.id} does not have a thread id`)\n }\n\n let signingKey: Kms.PublicJwk<Kms.Ed25519PublicJwk>\n const firstService = outOfBandRecord.outOfBandInvitation.getServices()[0]\n if (typeof firstService === 'string') {\n const dids = agentContext.resolve(DidsApi)\n const resolved = await dids.resolveCreatedDidDocumentWithKeys(parseDid(firstService).did)\n\n const recipientKeys = resolved.didDocument.getRecipientKeysWithVerificationMethod({ mapX25519ToEd25519: true })\n if (recipientKeys.length === 0) {\n throw new CredoError(`Unable to extract signing key for connection response from did '${firstService}'`)\n }\n\n signingKey = recipientKeys[0].publicJwk\n // TOOD: we probably need an util: addKeyIdToVerificationMethodKey\n signingKey.keyId =\n resolved.keys?.find(({ didDocumentRelativeKeyId }) =>\n recipientKeys[0].verificationMethod.id.endsWith(didDocumentRelativeKeyId)\n )?.kmsKeyId ?? signingKey.legacyKeyId\n } else {\n const service = getResolvedDidcommServiceWithSigningKeyId(\n firstService,\n outOfBandRecord.invitationInlineServiceKeys\n )\n signingKey = service.recipientKeys[0]\n }\n\n const connectionResponse = new DidCommConnectionResponseMessage({\n threadId: connectionRecord.threadId,\n connectionSig: await signData(agentContext, connectionJson, signingKey),\n })\n\n connectionRecord.did = peerDid\n await this.updateState(agentContext, connectionRecord, DidCommDidExchangeState.ResponseSent)\n\n this.logger.debug(`Create message ${DidCommConnectionResponseMessage.type.messageTypeUri} end`, {\n connectionRecord,\n message: connectionResponse,\n })\n return {\n connectionRecord,\n message: connectionResponse,\n }\n }\n\n /**\n * Process a received connection response message. This will not accept the connection request\n * or send a connection acknowledgement message. It will only update the existing connection record\n * with all the new information from the connection response message. Use {@link DidCommConnectionService.createTrustPing}\n * after calling this function to create a trust ping message.\n *\n * @param messageContext the message context containing a connection response message\n * @returns updated connection record\n */\n public async processResponse(\n messageContext: DidCommInboundMessageContext<DidCommConnectionResponseMessage>,\n outOfBandRecord: DidCommOutOfBandRecord\n ): Promise<DidCommConnectionRecord> {\n this.logger.debug(`Process message ${DidCommConnectionResponseMessage.type.messageTypeUri} start`, {\n message: messageContext.message,\n })\n const { connection: connectionRecord, message, recipientKey, senderKey } = messageContext\n\n if (!recipientKey || !senderKey) {\n throw new CredoError('Unable to process connection request without senderKey or recipientKey')\n }\n\n if (!connectionRecord) {\n throw new CredoError('No connection record in message context.')\n }\n\n connectionRecord.assertState(DidCommDidExchangeState.RequestSent)\n connectionRecord.assertRole(DidCommDidExchangeRole.Requester)\n\n let connectionJson = null\n try {\n connectionJson = await unpackAndVerifySignatureDecorator(messageContext.agentContext, message.connectionSig)\n } catch (error) {\n if (error instanceof CredoError) {\n throw new ConnectionProblemReportError(error.message, {\n problemCode: ConnectionProblemReportReason.ResponseProcessingError,\n })\n }\n throw error\n }\n\n const connection = JsonTransformer.fromJSON(connectionJson, DidCommConnection)\n\n // Per the Connection RFC we must check if the key used to sign the connection~sig is the same key\n // as the recipient key(s) in the connection invitation message\n const signerVerkey = message.connectionSig.signer\n\n const invitationKey = Kms.PublicJwk.fromFingerprint(outOfBandRecord.getTags().recipientKeyFingerprints[0])\n if (!invitationKey.is(Kms.Ed25519PublicJwk)) {\n throw new ConnectionProblemReportError(\n `Expected invitation key to be an Ed25519 key, found ${invitationKey.jwkTypehumanDescription}`,\n { problemCode: ConnectionProblemReportReason.ResponseNotAccepted }\n )\n }\n\n const invitationKeyBase58 = TypedArrayEncoder.toBase58(invitationKey.publicKey.publicKey)\n\n if (signerVerkey !== invitationKeyBase58) {\n throw new ConnectionProblemReportError(\n `Connection object in connection response message is not signed with same key as recipient key in invitation expected='${invitationKey}' received='${signerVerkey}'`,\n { problemCode: ConnectionProblemReportReason.ResponseNotAccepted }\n )\n }\n\n if (!connection.didDoc) {\n throw new CredoError('DID Document is missing.')\n }\n\n const { did: peerDid } = await this.createDid(messageContext.agentContext, {\n role: DidDocumentRole.Received,\n didDoc: connection.didDoc,\n })\n\n connectionRecord.theirDid = peerDid\n connectionRecord.threadId = message.threadId\n\n await this.updateState(messageContext.agentContext, connectionRecord, DidCommDidExchangeState.ResponseReceived)\n return connectionRecord\n }\n\n /**\n * Create a trust ping message for the connection with the specified connection id.\n *\n * By default a trust ping message should elicit a response. If this is not desired the\n * `config.responseRequested` property can be set to `false`.\n *\n * @param connectionRecord the connection for which to create a trust ping message\n * @param config the config for the trust ping message\n * @returns outbound message containing trust ping message\n */\n public async createTrustPing(\n agentContext: AgentContext,\n connectionRecord: DidCommConnectionRecord,\n config: { responseRequested?: boolean; comment?: string } = {}\n ): Promise<ConnectionProtocolMsgReturnType<DidCommTrustPingMessage>> {\n connectionRecord.assertState([DidCommDidExchangeState.ResponseReceived, DidCommDidExchangeState.Completed])\n\n // TODO:\n // - create ack message\n // - maybe this shouldn't be in the connection service?\n const trustPing = new DidCommTrustPingMessage(config)\n\n // Only update connection record and emit an event if the state is not already 'Complete'\n if (connectionRecord.state !== DidCommDidExchangeState.Completed) {\n await this.updateState(agentContext, connectionRecord, DidCommDidExchangeState.Completed)\n }\n\n return {\n connectionRecord,\n message: trustPing,\n }\n }\n\n /**\n * Process a received ack message. This will update the state of the connection\n * to Completed if this is not already the case.\n *\n * @param messageContext the message context containing an ack message\n * @returns updated connection record\n */\n public async processAck(\n messageContext: DidCommInboundMessageContext<DidCommAckMessage>\n ): Promise<DidCommConnectionRecord> {\n const { connection, recipientKey } = messageContext\n\n if (!connection) {\n throw new CredoError(\n `Unable to process connection ack: connection for recipient key ${recipientKey?.fingerprint} not found`\n )\n }\n\n // TODO: This is better addressed in a middleware of some kind because\n // any message can transition the state to complete, not just an ack or trust ping\n if (\n connection.state === DidCommDidExchangeState.ResponseSent &&\n connection.role === DidCommDidExchangeRole.Responder\n ) {\n await this.updateState(messageContext.agentContext, connection, DidCommDidExchangeState.Completed)\n }\n\n return connection\n }\n\n /**\n * Process a received {@link DidCommProblemReportMessage}.\n *\n * @param messageContext The message context containing a connection problem report message\n * @returns connection record associated with the connection problem report message\n *\n */\n public async processProblemReport(\n messageContext: DidCommInboundMessageContext<DidCommConnectionProblemReportMessage>\n ): Promise<DidCommConnectionRecord> {\n const { message: connectionProblemReportMessage, recipientKey, senderKey } = messageContext\n\n this.logger.debug(`Processing connection problem report for verkey ${recipientKey?.fingerprint}`)\n\n if (!recipientKey) {\n throw new CredoError('Unable to process connection problem report without recipientKey')\n }\n\n const ourDidRecord = await this.didRepository.findCreatedDidByRecipientKey(\n messageContext.agentContext,\n recipientKey\n )\n if (!ourDidRecord) {\n throw new CredoError(\n `Unable to process connection problem report: created did record for recipient key ${recipientKey.fingerprint} not found`\n )\n }\n\n const connectionRecord = await this.findByOurDid(messageContext.agentContext, ourDidRecord.did)\n if (!connectionRecord) {\n throw new CredoError(\n `Unable to process connection problem report: connection for recipient key ${recipientKey.fingerprint} not found`\n )\n }\n\n const theirDidRecord =\n connectionRecord.theirDid &&\n (await this.didRepository.findReceivedDid(messageContext.agentContext, connectionRecord.theirDid))\n if (!theirDidRecord) {\n throw new CredoError(`Received did record for did ${connectionRecord.theirDid} not found.`)\n }\n\n if (senderKey) {\n if (!theirDidRecord?.getTags().recipientKeyFingerprints?.includes(senderKey.fingerprint)) {\n throw new CredoError(\"Sender key doesn't match key of connection record\")\n }\n }\n\n connectionRecord.errorMessage = `${connectionProblemReportMessage.description.code} : ${connectionProblemReportMessage.description.en}`\n await this.update(messageContext.agentContext, connectionRecord)\n\n // Marking connection as abandoned in case of problem report from issuer agent\n // TODO: Can be conditionally abandoned - Like if another user is scanning already used connection invite where issuer will send invite-already-used problem code.\n await this.updateState(messageContext.agentContext, connectionRecord, DidCommDidExchangeState.Abandoned)\n\n return connectionRecord\n }\n\n /**\n * Assert that an inbound message either has a connection associated with it,\n * or has everything correctly set up for connection-less exchange (optionally with out of band)\n *\n * @param messageContext - the inbound message context\n */\n public async assertConnectionOrOutOfBandExchange(\n messageContext: DidCommInboundMessageContext,\n {\n lastSentMessage,\n lastReceivedMessage,\n expectedConnectionId,\n }: {\n lastSentMessage?: DidCommMessage | null\n lastReceivedMessage?: DidCommMessage | null\n expectedConnectionId?: string\n } = {}\n ) {\n const { connection, message } = messageContext\n\n if (expectedConnectionId && !connection) {\n throw new CredoError(\n `Expected incoming message to be from connection ${expectedConnectionId} but no connection found.`\n )\n }\n if (expectedConnectionId && connection?.id !== expectedConnectionId) {\n throw new CredoError(\n `Expected incoming message to be from connection ${expectedConnectionId} but connection is ${connection?.id}.`\n )\n }\n\n // Check if we have a ready connection. Verification is already done somewhere else. Return\n if (connection) {\n connection.assertReady()\n this.logger.debug(`Processing message with id ${message.id} and connection id ${connection.id}`, {\n type: message.type,\n })\n } else {\n this.logger.debug(`Processing connection-less message with id ${message.id}`, {\n type: message.type,\n })\n\n const recipientKey = messageContext.recipientKey\n const senderKey = messageContext.senderKey\n\n // set theirService to the value of lastReceivedMessage.service\n let theirService =\n messageContext.message?.service?.resolvedDidCommService ?? lastReceivedMessage?.service?.resolvedDidCommService\n let ourService = lastSentMessage?.service?.resolvedDidCommService\n\n // FIXME: we should remove support for the flow where no out of band record is used.\n // Users have had enough time to update to the OOB API which supports legacy connectionsless\n // invitations as well\n // 1. check if there's an oob record associated.\n const outOfBandRepository = messageContext.agentContext.dependencyManager.resolve(DidCommOutOfBandRepository)\n const outOfBandService = messageContext.agentContext.dependencyManager.resolve(DidCommOutOfBandService)\n const outOfBandRecord = await outOfBandRepository.findSingleByQuery(messageContext.agentContext, {\n invitationRequestsThreadIds: [message.threadId],\n })\n\n // If we have an out of band record, we can extract the service for our/the other party from the oob record\n if (outOfBandRecord?.role === DidCommOutOfBandRole.Sender) {\n ourService = await outOfBandService.getResolvedServiceForOutOfBandServices(\n messageContext.agentContext,\n outOfBandRecord.outOfBandInvitation.getServices(),\n outOfBandRecord.invitationInlineServiceKeys\n )\n } else if (outOfBandRecord?.role === DidCommOutOfBandRole.Receiver) {\n theirService = await outOfBandService.getResolvedServiceForOutOfBandServices(\n messageContext.agentContext,\n outOfBandRecord.outOfBandInvitation.getServices()\n )\n }\n\n // theirService can be null when we receive an oob invitation and process the message.\n // In this case there MUST be an oob record, otherwise there is no way for us to reply\n // to the message\n if (!theirService && !outOfBandRecord) {\n throw new CredoError(\n 'No service for incoming connection-less message and no associated out of band record found.'\n )\n }\n\n // ourService can be null when we receive an oob invitation or legacy connectionless message and process the message.\n // In this case lastSentMessage and lastReceivedMessage MUST be null, because there shouldn't be any previous exchange\n if (!ourService && (lastReceivedMessage || lastSentMessage)) {\n throw new CredoError(\n 'No keys on our side to use for encrypting messages, and previous messages found (in which case our keys MUST also be present).'\n )\n }\n\n // If the message is unpacked or AuthCrypt, there cannot be any previous exchange (this must be the first message).\n // All exchange after the first unpacked oob exchange MUST be encrypted.\n if ((!senderKey || !recipientKey) && (lastSentMessage || lastReceivedMessage)) {\n throw new CredoError(\n 'Incoming message must have recipientKey and senderKey (so cannot be AuthCrypt or unpacked) if there are lastSentMessage or lastReceivedMessage.'\n )\n }\n\n // Check if recipientKey is in ourService\n if (recipientKey && ourService) {\n const recipientKeyFound = ourService.recipientKeys.some((key) => recipientKey.equals(key))\n if (!recipientKeyFound) {\n throw new CredoError(`Recipient key ${recipientKey.fingerprint} not found in our service`)\n }\n }\n\n // Check if senderKey is in theirService\n if (senderKey && theirService) {\n const senderKeyFound = theirService.recipientKeys.some((key) => senderKey.equals(key))\n if (!senderKeyFound) {\n throw new CredoError(`Sender key ${senderKey.fingerprint} not found in their service.`)\n }\n }\n }\n }\n\n /**\n * If knownConnectionId is passed, it will compare the incoming connection id with the knownConnectionId, and skip the other validation.\n *\n * If no known connection id is passed, it asserts that the incoming message is in response to an attached request message to an out of band invitation.\n * If is the case, and the state of the out of band record is still await response, the state will be updated to done\n *\n */\n public async matchIncomingMessageToRequestMessageInOutOfBandExchange(\n messageContext: DidCommInboundMessageContext,\n { expectedConnectionId }: { expectedConnectionId?: string }\n ) {\n if (expectedConnectionId && messageContext.connection?.id !== expectedConnectionId) {\n throw new CredoError(\n `Expecting incoming message to have connection ${expectedConnectionId}, but incoming connection is ${\n messageContext.connection?.id ?? 'undefined'\n }`\n )\n }\n\n const outOfBandRepository = messageContext.agentContext.dependencyManager.resolve(DidCommOutOfBandRepository)\n const outOfBandInvitationId = messageContext.message.thread?.parentThreadId\n\n // Find the out of band record that is associated with this request\n const outOfBandRecord = await outOfBandRepository.findSingleByQuery(messageContext.agentContext, {\n invitationId: outOfBandInvitationId,\n role: DidCommOutOfBandRole.Sender,\n invitationRequestsThreadIds: [messageContext.message.threadId],\n })\n\n // There is no out of band record\n if (!outOfBandRecord) {\n throw new CredoError(\n `No out of band record found for credential request message with thread ${messageContext.message.threadId}, out of band invitation id ${outOfBandInvitationId} and role ${DidCommOutOfBandRole.Sender}`\n )\n }\n\n const legacyInvitationMetadata = outOfBandRecord.metadata.get(DidCommOutOfBandRecordMetadataKeys.LegacyInvitation)\n\n // If the original invitation was a legacy connectionless invitation, it's okay if the message does not have a pthid.\n if (\n legacyInvitationMetadata?.legacyInvitationType !== DidCommInvitationType.Connectionless &&\n outOfBandRecord.outOfBandInvitation.id !== outOfBandInvitationId\n ) {\n throw new CredoError(\n 'Response messages to out of band invitation requests MUST have a parent thread id that matches the out of band invitation id.'\n )\n }\n\n // This should not happen, as it is not allowed to create reusable out of band invitations with attached messages\n // But should that implementation change, we at least cover it here.\n if (outOfBandRecord.reusable) {\n throw new CredoError('Receiving messages in response to reusable out of band invitations is not supported.')\n }\n\n if (outOfBandRecord.state === DidCommOutOfBandState.Done) {\n if (!messageContext.connection) {\n throw new CredoError(\n \"Can't find connection associated with incoming message, while out of band state is done. State must be await response if no connection has been created\"\n )\n }\n if (messageContext.connection.outOfBandId !== outOfBandRecord.id) {\n throw new CredoError(\n 'Connection associated with incoming message is not associated with the out of band invitation containing the attached message.'\n )\n }\n\n // We're good to go. Connection was created and points to the correct out of band record. And the message is in response to an attached request message from the oob invitation.\n } else if (outOfBandRecord.state === DidCommOutOfBandState.AwaitResponse) {\n // We're good to go. Waiting for a response. And the message is in response to an attached request message from the oob invitation.\n\n // Now that we have received the first response message to our out of band invitation, we mark the out of band record as done\n outOfBandRecord.state = DidCommOutOfBandState.Done\n await outOfBandRepository.update(messageContext.agentContext, outOfBandRecord)\n } else {\n throw new CredoError(`Out of band record is in incorrect state ${outOfBandRecord.state}`)\n }\n }\n\n public async updateState(\n agentContext: AgentContext,\n connectionRecord: DidCommConnectionRecord,\n newState: DidCommDidExchangeState\n ) {\n const previousState = connectionRecord.state\n connectionRecord.state = newState\n await this.connectionRepository.update(agentContext, connectionRecord)\n\n this.emitStateChangedEvent(agentContext, connectionRecord, previousState)\n }\n\n private emitStateChangedEvent(\n agentContext: AgentContext,\n connectionRecord: DidCommConnectionRecord,\n previousState: DidCommDidExchangeState | null\n ) {\n this.eventEmitter.emit<DidCommConnectionStateChangedEvent>(agentContext, {\n type: DidCommConnectionEventTypes.DidCommConnectionStateChanged,\n payload: {\n // Connection record in event should be static\n connectionRecord: connectionRecord.clone(),\n previousState,\n },\n })\n }\n\n public update(agentContext: AgentContext, connectionRecord: DidCommConnectionRecord) {\n return this.connectionRepository.update(agentContext, connectionRecord)\n }\n\n /**\n * Retrieve all connections records\n *\n * @returns List containing all connection records\n */\n public getAll(agentContext: AgentContext) {\n return this.connectionRepository.getAll(agentContext)\n }\n\n /**\n * Retrieve a connection record by id\n *\n * @param connectionId The connection record id\n * @throws {RecordNotFoundError} If no record is found\n * @return The connection record\n *\n */\n public getById(agentContext: AgentContext, connectionId: string): Promise<DidCommConnectionRecord> {\n return this.connectionRepository.getById(agentContext, connectionId)\n }\n\n /**\n * Find a connection record by id\n *\n * @param connectionId the connection record id\n * @returns The connection record or null if not found\n */\n public findById(agentContext: AgentContext, connectionId: string): Promise<DidCommConnectionRecord | null> {\n return this.connectionRepository.findById(agentContext, connectionId)\n }\n\n /**\n * Delete a connection record by id\n *\n * @param connectionId the connection record id\n */\n public async deleteById(agentContext: AgentContext, connectionId: string) {\n const connectionRecord = await this.getById(agentContext, connectionId)\n return this.connectionRepository.delete(agentContext, connectionRecord)\n }\n\n public async findByDids(agentContext: AgentContext, query: { ourDid: string; theirDid: string }) {\n return this.connectionRepository.findByDids(agentContext, query)\n }\n\n /**\n * Retrieve a connection record by thread id\n *\n * @param threadId The thread id\n * @throws {RecordNotFoundError} If no record is found\n * @throws {RecordDuplicateError} If multiple records are found\n * @returns The connection record\n */\n public async getByThreadId(agentContext: AgentContext, threadId: string): Promise<DidCommConnectionRecord> {\n return this.connectionRepository.getByThreadId(agentContext, threadId)\n }\n\n public async getByRoleAndThreadId(agentContext: AgentContext, role: DidCommDidExchangeRole, threadId: string) {\n return this.connectionRepository.getByRoleAndThreadId(agentContext, role, threadId)\n }\n\n public async findByTheirDid(agentContext: AgentContext, theirDid: string): Promise<DidCommConnectionRecord | null> {\n return this.connectionRepository.findSingleByQuery(agentContext, { theirDid })\n }\n\n public async findByOurDid(agentContext: AgentContext, ourDid: string): Promise<DidCommConnectionRecord | null> {\n return this.connectionRepository.findSingleByQuery(agentContext, { did: ourDid })\n }\n\n public async findAllByOutOfBandId(agentContext: AgentContext, outOfBandId: string) {\n return this.connectionRepository.findByQuery(agentContext, { outOfBandId })\n }\n\n public async findAllByConnectionTypes(\n agentContext: AgentContext,\n connectionTypes: Array<DidCommConnectionType | string>\n ) {\n return this.connectionRepository.findByQuery(agentContext, { connectionTypes })\n }\n\n public async findByInvitationDid(agentContext: AgentContext, invitationDid: string) {\n return this.connectionRepository.findByQuery(agentContext, { invitationDid })\n }\n\n public async findByKeys(\n agentContext: AgentContext,\n {\n senderKey,\n recipientKey,\n }: { senderKey: Kms.PublicJwk<Kms.Ed25519PublicJwk>; recipientKey: Kms.PublicJwk<Kms.Ed25519PublicJwk> }\n ) {\n const theirDidRecord = await this.didRepository.findReceivedDidByRecipientKey(agentContext, senderKey)\n if (theirDidRecord) {\n const ourDidRecord = await this.didRepository.findCreatedDidByRecipientKey(agentContext, recipientKey)\n if (ourDidRecord) {\n const connectionRecord = await this.findByDids(agentContext, {\n ourDid: ourDidRecord.did,\n theirDid: theirDidRecord.did,\n })\n if (connectionRecord?.isReady) return connectionRecord\n }\n }\n\n this.logger.debug(\n `No connection record found for encrypted message with recipient key ${recipientKey.fingerprint} and sender key ${senderKey.fingerprint}`\n )\n\n return null\n }\n\n public async findAllByQuery(\n agentContext: AgentContext,\n query: Query<DidCommConnectionRecord>,\n queryOptions?: QueryOptions\n ): Promise<DidCommConnectionRecord[]> {\n return this.connectionRepository.findByQuery(agentContext, query, queryOptions)\n }\n\n public async createConnection(\n agentContext: AgentContext,\n options: DidCommConnectionRecordProps\n ): Promise<DidCommConnectionRecord> {\n const connectionRecord = new DidCommConnectionRecord(options)\n await this.connectionRepository.save(agentContext, connectionRecord)\n return connectionRecord\n }\n\n public async addConnectionType(agentContext: AgentContext, connectionRecord: DidCommConnectionRecord, type: string) {\n const connectionTypes = connectionRecord.connectionTypes || []\n connectionRecord.connectionTypes = [type, ...connectionTypes]\n await this.update(agentContext, connectionRecord)\n }\n\n public async removeConnectionType(\n agentContext: AgentContext,\n connectionRecord: DidCommConnectionRecord,\n type: string\n ) {\n connectionRecord.connectionTypes = connectionRecord.connectionTypes.filter((value) => value !== type)\n await this.update(agentContext, connectionRecord)\n }\n\n public async getConnectionTypes(connectionRecord: DidCommConnectionRecord) {\n return connectionRecord.connectionTypes || []\n }\n\n private async createDid(\n agentContext: AgentContext,\n { role, didDoc, keys }: { role: DidDocumentRole; didDoc: DidDoc; keys?: DidDocumentKey[] }\n ) {\n if (keys && role !== DidDocumentRole.Created) {\n throw new CredoError(`keys can only be provided for did documents when the role is '${DidDocumentRole.Created}'`)\n }\n\n // Convert the legacy did doc to a new did document\n const { didDocument, keys: updatedKeys } = convertToNewDidDocument(didDoc, keys)\n\n // Assert that the keys we are going to use for creating a did document haven't already been used in another did document\n if (role === DidDocumentRole.Created) {\n await assertNoCreatedDidExistsForKeys(agentContext, didDocument.recipientKeys)\n }\n\n const peerDid = didDocumentJsonToNumAlgo1Did(didDocument.toJSON())\n didDocument.id = peerDid\n const didRecord = new DidRecord({\n did: peerDid,\n role,\n didDocument,\n keys: updatedKeys,\n })\n\n // Store the unqualified did with the legacy did document in the metadata\n // Can be removed at a later stage if we know for sure we don't need it anymore\n didRecord.metadata.set(DidRecordMetadataKeys.LegacyDid, {\n unqualifiedDid: didDoc.id,\n didDocumentString: JsonTransformer.serialize(didDoc),\n })\n\n this.logger.debug('Saving DID record', {\n id: didRecord.id,\n did: didRecord.did,\n role: didRecord.role,\n tags: didRecord.getTags(),\n didDocument: 'omitted...',\n })\n\n await this.didRepository.save(agentContext, didRecord)\n this.logger.debug('Did record created.', didRecord)\n return { did: peerDid, didDocument }\n }\n\n private createDidDoc(routing: DidCommRouting) {\n const recipientKeyBase58 = TypedArrayEncoder.toBase58(routing.recipientKey.publicKey.publicKey)\n const indyDid = utils.indyDidFromPublicKeyBase58(recipientKeyBase58)\n\n const keys: DidDocumentKey[] = [\n {\n didDocumentRelativeKeyId: '#1',\n kmsKeyId: routing.recipientKey.keyId,\n },\n ]\n\n const publicKey = new Ed25119Sig2018({\n id: `${indyDid}#1`,\n controller: indyDid,\n publicKeyBase58: recipientKeyBase58,\n })\n\n const auth = new ReferencedAuthentication(publicKey, authenticationTypes.Ed25519VerificationKey2018)\n\n // IndyAgentService is old service type\n const services = routing.endpoints.map(\n (endpoint, index) =>\n new IndyAgentService({\n id: `${indyDid}#IndyAgentService-${index + 1}`,\n serviceEndpoint: endpoint,\n recipientKeys: [recipientKeyBase58],\n routingKeys: routing.routingKeys.map((key) => TypedArrayEncoder.toBase58(key.publicKey.publicKey)),\n // Order of endpoint determines priority\n priority: index,\n })\n )\n\n return {\n didDoc: new DidDoc({\n id: indyDid,\n authentication: [auth],\n service: services,\n publicKey: [publicKey],\n }),\n keys,\n }\n }\n\n private createDidDocFromOutOfBandDidCommServices(outOfBandRecord: DidCommOutOfBandRecord) {\n const services = outOfBandRecord.outOfBandInvitation\n .getInlineServices()\n .map((service) => getResolvedDidcommServiceWithSigningKeyId(service, outOfBandRecord.invitationInlineServiceKeys))\n\n const [recipientKey] = services[0].recipientKeys\n const recipientKeyBase58 = TypedArrayEncoder.toBase58(recipientKey.publicKey.publicKey)\n const did = utils.indyDidFromPublicKeyBase58(recipientKeyBase58)\n\n const publicKey = new Ed25119Sig2018({\n id: `${did}#1`,\n controller: did,\n publicKeyBase58: recipientKeyBase58,\n })\n\n const auth = new ReferencedAuthentication(publicKey, authenticationTypes.Ed25519VerificationKey2018)\n\n // IndyAgentService is old service type\n const service = services.map(\n (service, index) =>\n new IndyAgentService({\n id: `${did}#IndyAgentService-${index + 1}`,\n serviceEndpoint: service.serviceEndpoint,\n recipientKeys: [recipientKeyBase58],\n routingKeys: service.routingKeys?.map((publicJwk) =>\n TypedArrayEncoder.toBase58(publicJwk.publicKey.publicKey)\n ),\n priority: index,\n })\n )\n\n return {\n didDoc: new DidDoc({\n id: did,\n authentication: [auth],\n service,\n publicKey: [publicKey],\n }),\n keys: [{ didDocumentRelativeKeyId: '#1', kmsKeyId: recipientKey.keyId }] satisfies DidDocumentKey[],\n }\n }\n\n public async returnWhenIsConnected(\n agentContext: AgentContext,\n connectionId: string,\n timeoutMs = 20000\n ): Promise<DidCommConnectionRecord> {\n const isConnected = (connection: DidCommConnectionRecord) => {\n return connection.id === connectionId && connection.state === DidCommDidExchangeState.Completed\n }\n\n const observable = this.eventEmitter.observable<DidCommConnectionStateChangedEvent>(\n DidCommConnectionEventTypes.DidCommConnectionStateChanged\n )\n const subject = new ReplaySubject<DidCommConnectionRecord>(1)\n\n observable\n .pipe(\n filterContextCorrelationId(agentContext.contextCorrelationId),\n map((e) => e.payload.connectionRecord),\n first(isConnected), // Do not wait for longer than specified timeout\n timeout({\n first: timeoutMs,\n meta: 'DidCommConnectionService.returnWhenIsConnected',\n })\n )\n .subscribe(subject)\n\n const connection = await this.getById(agentContext, connectionId)\n if (isConnected(connection)) {\n subject.next(connection)\n }\n\n return firstValueFrom(subject)\n }\n}\n\nexport interface ConnectionProtocolMsgReturnType<MessageType extends DidCommMessage> {\n message: MessageType\n connectionRecord: DidCommConnectionRecord\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqEO,qCAAMA,2BAAyB;CAMpC,AAAO,YACL,AAAiCC,QACjC,sBACA,eACA,cACA;AACA,OAAK,uBAA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AO;IACjB,IAAI;IACJ,gBAAgB,CAAC,KAAK;IACtB;IACA,WAAW,CAAC,UAAU;IACvB,CAAC;GACF,MAAM,CAAC;IAAE,0BAA0B;IAAM,UAAU,aAAa;IAAO,CAAC;GACzE;;CAGH,MAAa,sBACX,cACA,cACA,YAAY,KACsB;EAClC,MAAM,eAAe,iBAAwC;AAC3D,UAAOC,aAAW,OAAO,gBAAgBA,aAAW,UAAU,wBAAwB;;EAGxF,MAAM,aAAa,KAAK,aAAa,WACnC,4BAA4B,8BAC7B;EACD,MAAM,UAAU,IAAI,cAAuC,EAAE;AAE7D,aACG,KACC,2BAA2B,aAAa,qBAAqB,EAC7DC,OAAK,MAAM,EAAE,QAAQ,iBAAiB,EACtCC,QAAM,YAAY,EAClBC,UAAQ;GACN,OAAO;GACP,MAAM;GACP,CAAC,CACH,CACA,UAAU,QAAQ;EAErB,MAAM,aAAa,MAAM,KAAK,QAAQ,cAAc,aAAa;AACjE,MAAI,YAAY,WAAW,CACzB,SAAQ,KAAK,WAAW;AAG1B,SAAO,eAAe,QAAQ;;;;CAj8BjC,YAAY;oBAQR,OAAO,iBAAiB,OAAO"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { DidCommDidRotateProblemReportMessage } from "../messages/DidCommDidRotateProblemReportMessage.mjs";
|
|
2
|
-
import { DidCommDidRotateMessage } from "../messages/DidCommDidRotateMessage.mjs";
|
|
3
1
|
import { DidCommDidRotateAckMessage } from "../messages/DidCommDidRotateAckMessage.mjs";
|
|
2
|
+
import { DidCommDidRotateMessage } from "../messages/DidCommDidRotateMessage.mjs";
|
|
3
|
+
import { DidCommDidRotateProblemReportMessage } from "../messages/DidCommDidRotateProblemReportMessage.mjs";
|
|
4
4
|
import { DidCommHangupMessage } from "../messages/DidCommHangupMessage.mjs";
|
|
5
5
|
import { DidCommConnectionRecord } from "../repository/DidCommConnectionRecord.mjs";
|
|
6
6
|
import { DidCommOutboundMessageContext } from "../../../models/DidCommOutboundMessageContext.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DidCommDidRotateService.d.mts","names":[],"sources":["../../../../src/modules/connections/services/DidCommDidRotateService.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"DidCommDidRotateService.d.mts","names":[],"sources":["../../../../src/modules/connections/services/DidCommDidRotateService.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;cAoCa,uBAAA;;;;kCAMW,4BACqB,sBAC3B;EARL,YAAA,CAAA,YAAA,EAgBK,YAhBkB,EAAA,OAAA,EAAA;IAAA,UAAA,EAiBT,uBAjBS;IAMZ,KAAA,CAAA,EAAA,MAAA;IACqB,OAAA,CAAA,EAUiC,cAVjC;MAUiD,OAT5E,CAS4E,uBAT5E,CAAA;cAQA,CAAA,YAAA,EAmDwB,YAnDxB,EAAA,OAAA,EAAA;IACS,UAAA,EAkDoD,uBAlDpD;MAkD6E,OAlD1B,CAkD0B,oBAlD1B,CAAA;;;;;;;;;;eAsGJ,CAAA,cAAA,EA1B7B,4BA0B6B,CA1BA,oBA0BA,CAAA,CAAA,EA1BqB,OA0BrB,CAAA,IAAA,CAAA;;;;;;;;;;eAiHzB,CAAA,cAAA,EAjHJ,4BAiHI,CAjHyB,uBAiHzB,CAAA,CAAA,EAjHiD,OAiHjD,CAjHiD,6BAiHjD,CAjHiD,oCAiHjD,CAAA,GAjHiD,6BAiHjD,CAjHiD,0BAiHjD,CAAA,CAAA;kBAA7B,CAAA,cAAA,EAxC4B,4BAwC5B,CAxCyD,0BAwCzD,CAAA,CAAA,EAxCoF,OAwCpF,CAAA,IAAA,CAAA;;;;;;;;uCAAA,6BAA6B,wCAC5C;qCAmB6C,0BAA0B,0BAAuB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { DidCommDidRotateProblemReportMessage } from "../messages/DidCommDidRotateProblemReportMessage.js";
|
|
2
|
-
import { DidCommDidRotateMessage } from "../messages/DidCommDidRotateMessage.js";
|
|
3
1
|
import { DidCommDidRotateAckMessage } from "../messages/DidCommDidRotateAckMessage.js";
|
|
2
|
+
import { DidCommDidRotateMessage } from "../messages/DidCommDidRotateMessage.js";
|
|
3
|
+
import { DidCommDidRotateProblemReportMessage } from "../messages/DidCommDidRotateProblemReportMessage.js";
|
|
4
4
|
import { DidCommHangupMessage } from "../messages/DidCommHangupMessage.js";
|
|
5
5
|
import { DidCommConnectionRecord } from "../repository/DidCommConnectionRecord.js";
|
|
6
6
|
import { DidCommOutboundMessageContext } from "../../../models/DidCommOutboundMessageContext.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DidCommDidRotateService.d.ts","names":[],"sources":["../../../../src/modules/connections/services/DidCommDidRotateService.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"DidCommDidRotateService.d.ts","names":[],"sources":["../../../../src/modules/connections/services/DidCommDidRotateService.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;cAoCa,uBAAA;;;;kCAMW,4BACqB,sBAC3B;EARL,YAAA,CAAA,YAAA,EAgBK,YAhBkB,EAAA,OAAA,EAAA;IAAA,UAAA,EAiBT,uBAjBS;IAMZ,KAAA,CAAA,EAAA,MAAA;IACqB,OAAA,CAAA,EAUiC,cAVjC;MAUiD,OAT5E,CAS4E,uBAT5E,CAAA;cAQA,CAAA,YAAA,EAmDwB,YAnDxB,EAAA,OAAA,EAAA;IACS,UAAA,EAkDoD,uBAlDpD;MAkD6E,OAlD1B,CAkD0B,oBAlD1B,CAAA;;;;;;;;;;eAsGJ,CAAA,cAAA,EA1B7B,4BA0B6B,CA1BA,oBA0BA,CAAA,CAAA,EA1BqB,OA0BrB,CAAA,IAAA,CAAA;;;;;;;;;;eAiHzB,CAAA,cAAA,EAjHJ,4BAiHI,CAjHyB,uBAiHzB,CAAA,CAAA,EAjHiD,OAiHjD,CAjHiD,6BAiHjD,CAjHiD,oCAiHjD,CAAA,GAjHiD,6BAiHjD,CAjHiD,0BAiHjD,CAAA,CAAA;kBAA7B,CAAA,cAAA,EAxC4B,4BAwC5B,CAxCyD,0BAwCzD,CAAA,CAAA,EAxCoF,OAwCpF,CAAA,IAAA,CAAA;;;;;;;;uCAAA,6BAA6B,wCAC5C;qCAmB6C,0BAA0B,0BAAuB"}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.js');
|
|
2
|
-
const require_decorateMetadata = require('../../../_virtual/_@oxc-project_runtime@0.94.0/helpers/decorateMetadata.js');
|
|
3
2
|
const require_decorate = require('../../../_virtual/_@oxc-project_runtime@0.94.0/helpers/decorate.js');
|
|
4
|
-
const
|
|
5
|
-
require('
|
|
3
|
+
const require_decorateMetadata = require('../../../_virtual/_@oxc-project_runtime@0.94.0/helpers/decorateMetadata.js');
|
|
4
|
+
const require_helpers = require('./helpers.js');
|
|
5
|
+
const require_decorateParam = require('../../../_virtual/_@oxc-project_runtime@0.94.0/helpers/decorateParam.js');
|
|
6
6
|
const require_DidCommOutboundMessageContext = require('../../../models/DidCommOutboundMessageContext.js');
|
|
7
7
|
require('../../../models/index.js');
|
|
8
|
-
const
|
|
9
|
-
const
|
|
8
|
+
const require_DidCommConnectionEvents = require('../DidCommConnectionEvents.js');
|
|
9
|
+
const require_DidCommAckMessage = require('../../../messages/common/DidCommAckMessage.js');
|
|
10
|
+
require('../../../messages/index.js');
|
|
10
11
|
const require_DidCommDidRotateAckMessage = require('../messages/DidCommDidRotateAckMessage.js');
|
|
12
|
+
const require_DidCommDidRotateMessage = require('../messages/DidCommDidRotateMessage.js');
|
|
13
|
+
const require_DidCommDidRotateProblemReportMessage = require('../messages/DidCommDidRotateProblemReportMessage.js');
|
|
11
14
|
const require_DidCommHangupMessage = require('../messages/DidCommHangupMessage.js');
|
|
12
15
|
require('../messages/index.js');
|
|
13
|
-
const require_decorateParam = require('../../../_virtual/_@oxc-project_runtime@0.94.0/helpers/decorateParam.js');
|
|
14
|
-
const require_helpers = require('./helpers.js');
|
|
15
|
-
const require_DidCommConnectionEvents = require('../DidCommConnectionEvents.js');
|
|
16
16
|
const require_DidCommConnectionService = require('./DidCommConnectionService.js');
|
|
17
17
|
const require_DidCommConnectionMetadataTypes = require('../repository/DidCommConnectionMetadataTypes.js');
|
|
18
18
|
const require_helpers$1 = require('../../routing/services/helpers.js');
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { __decorateMetadata } from "../../../_virtual/_@oxc-project_runtime@0.94.0/helpers/decorateMetadata.mjs";
|
|
2
1
|
import { __decorate } from "../../../_virtual/_@oxc-project_runtime@0.94.0/helpers/decorate.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import "
|
|
2
|
+
import { __decorateMetadata } from "../../../_virtual/_@oxc-project_runtime@0.94.0/helpers/decorateMetadata.mjs";
|
|
3
|
+
import { createPeerDidFromServices, routingToServices } from "./helpers.mjs";
|
|
4
|
+
import { __decorateParam } from "../../../_virtual/_@oxc-project_runtime@0.94.0/helpers/decorateParam.mjs";
|
|
5
5
|
import { DidCommOutboundMessageContext } from "../../../models/DidCommOutboundMessageContext.mjs";
|
|
6
6
|
import "../../../models/index.mjs";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { DidCommConnectionEventTypes } from "../DidCommConnectionEvents.mjs";
|
|
8
|
+
import { AckStatus } from "../../../messages/common/DidCommAckMessage.mjs";
|
|
9
|
+
import "../../../messages/index.mjs";
|
|
9
10
|
import { DidCommDidRotateAckMessage } from "../messages/DidCommDidRotateAckMessage.mjs";
|
|
11
|
+
import { DidCommDidRotateMessage } from "../messages/DidCommDidRotateMessage.mjs";
|
|
12
|
+
import { DidCommDidRotateProblemReportMessage } from "../messages/DidCommDidRotateProblemReportMessage.mjs";
|
|
10
13
|
import { DidCommHangupMessage } from "../messages/DidCommHangupMessage.mjs";
|
|
11
14
|
import "../messages/index.mjs";
|
|
12
|
-
import { __decorateParam } from "../../../_virtual/_@oxc-project_runtime@0.94.0/helpers/decorateParam.mjs";
|
|
13
|
-
import { createPeerDidFromServices, routingToServices } from "./helpers.mjs";
|
|
14
|
-
import { DidCommConnectionEventTypes } from "../DidCommConnectionEvents.mjs";
|
|
15
15
|
import { DidCommConnectionService } from "./DidCommConnectionService.mjs";
|
|
16
16
|
import { DidCommConnectionMetadataKeys } from "../repository/DidCommConnectionMetadataTypes.mjs";
|
|
17
17
|
import { getMediationRecordForDidDocument } from "../../routing/services/helpers.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DidCommDidRotateService.mjs","names":["DidCommDidRotateService","logger: Logger","resolvedDid: { keys: DidDocumentKey[] | undefined; didDocument: DidDocument }","mediatorId: string | undefined"],"sources":["../../../../src/modules/connections/services/DidCommDidRotateService.ts"],"sourcesContent":["import type { AgentContext, DidDocument, DidDocumentKey } from '@credo-ts/core'\nimport type { DidCommInboundMessageContext, DidCommRouting } from '../../../models'\nimport type { DidCommConnectionDidRotatedEvent } from '../DidCommConnectionEvents'\nimport type { DidCommConnectionRecord } from '../repository'\n\nimport {\n CredoError,\n DidRepository,\n DidResolverService,\n DidsApi,\n EventEmitter,\n InjectionSymbols,\n type Logger,\n PeerDidNumAlgo,\n getAlternativeDidsForPeerDid,\n getNumAlgoFromPeerDid,\n inject,\n injectable,\n isValidPeerDid,\n} from '@credo-ts/core'\n\nimport { AckStatus } from '../../../messages'\nimport { DidCommOutboundMessageContext } from '../../../models'\nimport { getMediationRecordForDidDocument } from '../../routing/services/helpers'\nimport { DidCommConnectionEventTypes } from '../DidCommConnectionEvents'\nimport { DidCommConnectionsModuleConfig } from '../DidCommConnectionsModuleConfig'\nimport {\n DidCommDidRotateAckMessage,\n DidCommDidRotateMessage,\n DidCommDidRotateProblemReportMessage,\n DidCommHangupMessage,\n} from '../messages'\nimport { DidCommConnectionMetadataKeys } from '../repository/DidCommConnectionMetadataTypes'\n\nimport { DidCommConnectionService } from './DidCommConnectionService'\nimport { createPeerDidFromServices, routingToServices } from './helpers'\n\n@injectable()\nexport class DidCommDidRotateService {\n private didResolverService: DidResolverService\n private logger: Logger\n private eventEmitter: EventEmitter\n\n public constructor(\n didResolverService: DidResolverService,\n @inject(InjectionSymbols.Logger) logger: Logger,\n eventEmitter: EventEmitter\n ) {\n this.didResolverService = didResolverService\n this.logger = logger\n this.eventEmitter = eventEmitter\n }\n\n public async createRotate(\n agentContext: AgentContext,\n options: { connection: DidCommConnectionRecord; toDid?: string; routing?: DidCommRouting }\n ) {\n const { connection, toDid, routing } = options\n\n const config = agentContext.resolve(DidCommConnectionsModuleConfig)\n const dids = agentContext.resolve(DidsApi)\n\n // Do not allow to receive concurrent did rotation flows\n const didRotateMetadata = connection.metadata.get(DidCommConnectionMetadataKeys.DidRotate)\n\n if (didRotateMetadata) {\n throw new CredoError(`There is already an existing opened did rotation flow for connection id ${connection.id}`)\n }\n\n let resolvedDid: { keys: DidDocumentKey[] | undefined; didDocument: DidDocument }\n let mediatorId: string | undefined\n // If did is specified, make sure we have all key material for it\n if (toDid) {\n resolvedDid = await dids.resolveCreatedDidDocumentWithKeys(toDid)\n mediatorId = (await getMediationRecordForDidDocument(agentContext, resolvedDid.didDocument))?.id\n\n // Otherwise, create a did:peer based on the provided routing\n } else {\n if (!routing) {\n throw new CredoError('Routing configuration must be defined when rotating to a new peer did')\n }\n\n resolvedDid = await createPeerDidFromServices(\n agentContext,\n routingToServices(routing),\n config.peerNumAlgoForDidRotation\n )\n mediatorId = routing.mediatorId\n }\n\n const message = new DidCommDidRotateMessage({ toDid: resolvedDid.didDocument.id })\n\n // We set new info into connection metadata for further 'sealing' it once we receive an acknowledge\n // All messages sent in-between will be using previous connection information\n connection.metadata.set(DidCommConnectionMetadataKeys.DidRotate, {\n threadId: message.threadId,\n did: resolvedDid.didDocument.id,\n mediatorId,\n })\n\n await agentContext.resolve(DidCommConnectionService).update(agentContext, connection)\n\n return message\n }\n\n public async createHangup(agentContext: AgentContext, options: { connection: DidCommConnectionRecord }) {\n const { connection } = options\n\n const message = new DidCommHangupMessage({})\n\n // Remove did to indicate termination status for this connection\n if (connection.did) {\n connection.previousDids = [...connection.previousDids, connection.did]\n }\n\n connection.did = undefined\n\n await agentContext.dependencyManager.resolve(DidCommConnectionService).update(agentContext, connection)\n\n return message\n }\n\n /**\n * Process a Hangup message and mark connection's theirDid as undefined so it is effectively terminated.\n * Connection Record itself is not deleted (TODO: config parameter to automatically do so)\n *\n * Its previous did will be stored in record in order to be able to recognize any message received\n * afterwards.\n *\n * @param messageContext\n */\n public async processHangup(messageContext: DidCommInboundMessageContext<DidCommHangupMessage>) {\n const connection = messageContext.assertReadyConnection()\n const { agentContext } = messageContext\n\n if (connection.theirDid) {\n connection.previousTheirDids = [...connection.previousTheirDids, connection.theirDid]\n }\n\n const previousTheirDid = connection.theirDid\n connection.theirDid = undefined\n\n await agentContext.dependencyManager.resolve(DidCommConnectionService).update(agentContext, connection)\n this.emitDidRotatedEvent(agentContext, connection, {\n previousTheirDid,\n })\n }\n\n /**\n * Process an incoming DID Rotate message and update connection if success. Any acknowledge\n * or problem report will be sent to the prior DID, so the created context will take former\n * connection record data\n *\n * @param paramInboundDidCommMessageContext\n * @param connection\n * @returns\n */\n public async processRotate(messageContext: DidCommInboundMessageContext<DidCommDidRotateMessage>) {\n const connection = messageContext.assertReadyConnection()\n const { message, agentContext } = messageContext\n\n // Check and store their new did\n const newDid = message.toDid\n\n // DID Rotation not supported for peer:1 dids, as we need explicit did document information\n if (isValidPeerDid(newDid) && getNumAlgoFromPeerDid(newDid) === PeerDidNumAlgo.GenesisDoc) {\n this.logger.error(`Unable to resolve DID Document for '${newDid}`)\n\n const response = new DidCommDidRotateProblemReportMessage({\n description: { en: 'DID Method Unsupported', code: 'e.did.method_unsupported' },\n })\n return new DidCommOutboundMessageContext(response, { agentContext, connection })\n }\n\n const didDocument = (await this.didResolverService.resolve(agentContext, newDid)).didDocument\n\n // Cannot resolve did\n if (!didDocument) {\n this.logger.error(`Unable to resolve DID Document for '${newDid}`)\n\n const response = new DidCommDidRotateProblemReportMessage({\n description: { en: 'DID Unresolvable', code: 'e.did.unresolvable' },\n })\n return new DidCommOutboundMessageContext(response, { agentContext, connection })\n }\n\n // Did is resolved but no compatible DIDComm services found\n if (!didDocument.didCommServices) {\n const response = new DidCommDidRotateProblemReportMessage({\n description: { en: 'DID Document Unsupported', code: 'e.did.doc_unsupported' },\n })\n return new DidCommOutboundMessageContext(response, { agentContext, connection })\n }\n\n // Send acknowledge to previous did and persist new did. Previous did will be stored in connection record in\n // order to still accept messages from it\n const outboundMessageContext = new DidCommOutboundMessageContext(\n new DidCommDidRotateAckMessage({\n threadId: message.threadId,\n status: AckStatus.OK,\n }),\n { agentContext, connection: connection.clone() }\n )\n\n // Store received did and update connection for further message processing\n await agentContext.dependencyManager.resolve(DidRepository).storeReceivedDid(agentContext, {\n did: didDocument.id,\n didDocument,\n tags: {\n // For did:peer, store any alternative dids (like short form did:peer:4),\n // it may have in order to relate any message referencing it\n alternativeDids: isValidPeerDid(didDocument.id) ? getAlternativeDidsForPeerDid(didDocument.id) : undefined,\n },\n })\n\n if (connection.theirDid) {\n connection.previousTheirDids = [...connection.previousTheirDids, connection.theirDid]\n }\n\n const previousTheirDid = connection.theirDid\n connection.theirDid = newDid\n\n await agentContext.dependencyManager.resolve(DidCommConnectionService).update(agentContext, connection)\n this.emitDidRotatedEvent(agentContext, connection, {\n previousTheirDid,\n })\n\n return outboundMessageContext\n }\n\n public async processRotateAck(inboundMessage: DidCommInboundMessageContext<DidCommDidRotateAckMessage>) {\n const { agentContext, message } = inboundMessage\n\n const connection = inboundMessage.assertReadyConnection()\n\n // Update connection info based on metadata set when creating the rotate message\n const didRotateMetadata = connection.metadata.get(DidCommConnectionMetadataKeys.DidRotate)\n\n if (!didRotateMetadata) {\n throw new CredoError(`No did rotation data found for connection with id '${connection.id}'`)\n }\n\n if (didRotateMetadata.threadId !== message.threadId) {\n throw new CredoError(\n `Existing did rotation flow thread id '${didRotateMetadata.threadId} does not match incoming message'`\n )\n }\n\n // Store previous did in order to still accept out-of-order messages that arrived later using it\n if (connection.did) connection.previousDids = [...connection.previousDids, connection.did]\n\n const previousOurDid = connection.did\n connection.did = didRotateMetadata.did\n connection.mediatorId = didRotateMetadata.mediatorId\n connection.metadata.delete(DidCommConnectionMetadataKeys.DidRotate)\n\n await agentContext.dependencyManager.resolve(DidCommConnectionService).update(agentContext, connection)\n this.emitDidRotatedEvent(agentContext, connection, {\n previousOurDid,\n })\n }\n\n /**\n * Process a problem report related to did rotate protocol, by simply deleting any temporary metadata.\n *\n * No specific event is thrown other than generic message processing\n *DidCommInboundMessageContext\n * @param messageContext\n */\n public async processProblemReport(\n messageContext: DidCommInboundMessageContext<DidCommDidRotateProblemReportMessage>\n ): Promise<void> {\n const { message, agentContext } = messageContext\n\n const connection = messageContext.assertReadyConnection()\n\n this.logger.debug(`Processing problem report with id ${message.id}`)\n\n // Delete any existing did rotation metadata in order to 'reset' the connection\n const didRotateMetadata = connection.metadata.get(DidCommConnectionMetadataKeys.DidRotate)\n\n if (!didRotateMetadata) {\n throw new CredoError(`No did rotation data found for connection with id '${connection.id}'`)\n }\n\n connection.metadata.delete(DidCommConnectionMetadataKeys.DidRotate)\n\n await agentContext.dependencyManager.resolve(DidCommConnectionService).update(agentContext, connection)\n }\n\n public async clearDidRotationData(agentContext: AgentContext, connection: DidCommConnectionRecord) {\n const didRotateMetadata = connection.metadata.get(DidCommConnectionMetadataKeys.DidRotate)\n\n if (!didRotateMetadata) {\n throw new CredoError(`No did rotation data found for connection with id '${connection.id}'`)\n }\n\n connection.metadata.delete(DidCommConnectionMetadataKeys.DidRotate)\n\n await agentContext.dependencyManager.resolve(DidCommConnectionService).update(agentContext, connection)\n }\n\n private emitDidRotatedEvent(\n agentContext: AgentContext,\n connectionRecord: DidCommConnectionRecord,\n { previousOurDid, previousTheirDid }: { previousOurDid?: string; previousTheirDid?: string }\n ) {\n this.eventEmitter.emit<DidCommConnectionDidRotatedEvent>(agentContext, {\n type: DidCommConnectionEventTypes.DidCommConnectionDidRotated,\n payload: {\n // Connection record in event should be static\n connectionRecord: connectionRecord.clone(),\n\n ourDid:\n previousOurDid && connectionRecord.did\n ? {\n from: previousOurDid,\n to: connectionRecord.did,\n }\n : undefined,\n\n theirDid:\n previousTheirDid && connectionRecord.theirDid\n ? {\n from: previousTheirDid,\n to: connectionRecord.theirDid,\n }\n : undefined,\n },\n })\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAsCO,oCAAMA,0BAAwB;CAKnC,AAAO,YACL,oBACA,AAAiCC,QACjC,cACA;AACA,OAAK,qBAAqB;AAC1B,OAAK,SAAS;AACd,OAAK,eAAe;;CAGtB,MAAa,aACX,cACA,SACA;EACA,MAAM,EAAE,YAAY,OAAO,YAAY;EAEvC,MAAM,SAAS,aAAa,QAAQ,+BAA+B;EACnE,MAAM,OAAO,aAAa,QAAQ,QAAQ;AAK1C,MAF0B,WAAW,SAAS,IAAI,8BAA8B,UAAU,CAGxF,OAAM,IAAI,WAAW,2EAA2E,WAAW,KAAK;EAGlH,IAAIC;EACJ,IAAIC;AAEJ,MAAI,OAAO;AACT,iBAAc,MAAM,KAAK,kCAAkC,MAAM;AACjE,iBAAc,MAAM,iCAAiC,cAAc,YAAY,YAAY,GAAG;SAGzF;AACL,OAAI,CAAC,QACH,OAAM,IAAI,WAAW,wEAAwE;AAG/F,iBAAc,MAAM,0BAClB,cACA,kBAAkB,QAAQ,EAC1B,OAAO,0BACR;AACD,gBAAa,QAAQ;;EAGvB,MAAM,UAAU,IAAI,wBAAwB,EAAE,OAAO,YAAY,YAAY,IAAI,CAAC;AAIlF,aAAW,SAAS,IAAI,8BAA8B,WAAW;GAC/D,UAAU,QAAQ;GAClB,KAAK,YAAY,YAAY;GAC7B;GACD,CAAC;AAEF,QAAM,aAAa,QAAQ,yBAAyB,CAAC,OAAO,cAAc,WAAW;AAErF,SAAO;;CAGT,MAAa,aAAa,cAA4B,SAAkD;EACtG,MAAM,EAAE,eAAe;EAEvB,MAAM,UAA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AK,oBAAoB,cAAc,YAAY,EACjD,gBACD,CAAC;;;;;;;;;CAUJ,MAAa,qBACX,gBACe;EACf,MAAM,EAAE,SAAS,iBAAiB;EAElC,MAAM,aAAa,eAAe,uBAAuB;AAEzD,OAAK,OAAO,MAAM,qCAAqC,QAAQ,KAAK;AAKpE,MAAI,CAFsB,WAAW,SAAS,IAAI,8BAA8B,UAAU,CAGxF,OAAM,IAAI,WAAW,sDAAsD,WAAW,GAAG,GAAG;AAG9F,aAAW,SAAS,OAAO,8BAA8B,UAAU;AAEnE,QAAM,aAAa,kBAAkB,QAAQ,yBAAyB,CAAC,OAAO,cAAc,WAAW;;CAGzG,MAAa,qBAAqB,cAA4B,YAAqC;AAGjG,MAAI,CAFsB,WAAW,SAAS,IAAI,8BAA8B,UAAU,CAGxF,OAAM,IAAI,WAAW,sDAAsD,WAAW,GAAG,GAAG;AAG9F,aAAW,SAAS,OAAO,8BAA8B,UAAU;AAEnE,QAAM,aAAa,kBAAkB,QAAQ,yBAAyB,CAAC,OAAO,cAAc,WAAW;;CAGzG,AAAQ,oBACN,cACA,kBACA,EAAE,gBAAgB,oBAClB;AACA,OAAK,aAAa,KAAuC,cAAc;GACrE,MAAM,4BAA4B;GAClC,SAAS;IAEP,kBAAkB,iBAAiB,OAAO;IAE1C,QACE,kBAAkB,iBAAiB,MAC/B;KACE,MAAM;KACN,IAAI,iBAAiB;KACtB,GACD;IAEN,UACE,oBAAoB,iBAAiB,WACjC;KACE,MAAM;KACN,IAAI,iBAAiB;KACtB,GACD;IACP;GACF,CAAC;;;;CApSL,YAAY;oBAQR,OAAO,iBAAiB,OAAO"}
|
|
1
|
+
{"version":3,"file":"DidCommDidRotateService.mjs","names":["DidCommDidRotateService","logger: Logger","resolvedDid: { keys: DidDocumentKey[] | undefined; didDocument: DidDocument }","mediatorId: string | undefined"],"sources":["../../../../src/modules/connections/services/DidCommDidRotateService.ts"],"sourcesContent":["import type { AgentContext, DidDocument, DidDocumentKey } from '@credo-ts/core'\nimport {\n CredoError,\n DidRepository,\n DidResolverService,\n DidsApi,\n EventEmitter,\n getAlternativeDidsForPeerDid,\n getNumAlgoFromPeerDid,\n InjectionSymbols,\n inject,\n injectable,\n isValidPeerDid,\n type Logger,\n PeerDidNumAlgo,\n} from '@credo-ts/core'\nimport { AckStatus } from '../../../messages'\nimport type { DidCommInboundMessageContext, DidCommRouting } from '../../../models'\nimport { DidCommOutboundMessageContext } from '../../../models'\nimport { getMediationRecordForDidDocument } from '../../routing/services/helpers'\nimport type { DidCommConnectionDidRotatedEvent } from '../DidCommConnectionEvents'\nimport { DidCommConnectionEventTypes } from '../DidCommConnectionEvents'\nimport { DidCommConnectionsModuleConfig } from '../DidCommConnectionsModuleConfig'\nimport {\n DidCommDidRotateAckMessage,\n DidCommDidRotateMessage,\n DidCommDidRotateProblemReportMessage,\n DidCommHangupMessage,\n} from '../messages'\nimport type { DidCommConnectionRecord } from '../repository'\nimport { DidCommConnectionMetadataKeys } from '../repository/DidCommConnectionMetadataTypes'\n\nimport { DidCommConnectionService } from './DidCommConnectionService'\nimport { createPeerDidFromServices, routingToServices } from './helpers'\n\n@injectable()\nexport class DidCommDidRotateService {\n private didResolverService: DidResolverService\n private logger: Logger\n private eventEmitter: EventEmitter\n\n public constructor(\n didResolverService: DidResolverService,\n @inject(InjectionSymbols.Logger) logger: Logger,\n eventEmitter: EventEmitter\n ) {\n this.didResolverService = didResolverService\n this.logger = logger\n this.eventEmitter = eventEmitter\n }\n\n public async createRotate(\n agentContext: AgentContext,\n options: { connection: DidCommConnectionRecord; toDid?: string; routing?: DidCommRouting }\n ) {\n const { connection, toDid, routing } = options\n\n const config = agentContext.resolve(DidCommConnectionsModuleConfig)\n const dids = agentContext.resolve(DidsApi)\n\n // Do not allow to receive concurrent did rotation flows\n const didRotateMetadata = connection.metadata.get(DidCommConnectionMetadataKeys.DidRotate)\n\n if (didRotateMetadata) {\n throw new CredoError(`There is already an existing opened did rotation flow for connection id ${connection.id}`)\n }\n\n let resolvedDid: { keys: DidDocumentKey[] | undefined; didDocument: DidDocument }\n let mediatorId: string | undefined\n // If did is specified, make sure we have all key material for it\n if (toDid) {\n resolvedDid = await dids.resolveCreatedDidDocumentWithKeys(toDid)\n mediatorId = (await getMediationRecordForDidDocument(agentContext, resolvedDid.didDocument))?.id\n\n // Otherwise, create a did:peer based on the provided routing\n } else {\n if (!routing) {\n throw new CredoError('Routing configuration must be defined when rotating to a new peer did')\n }\n\n resolvedDid = await createPeerDidFromServices(\n agentContext,\n routingToServices(routing),\n config.peerNumAlgoForDidRotation\n )\n mediatorId = routing.mediatorId\n }\n\n const message = new DidCommDidRotateMessage({ toDid: resolvedDid.didDocument.id })\n\n // We set new info into connection metadata for further 'sealing' it once we receive an acknowledge\n // All messages sent in-between will be using previous connection information\n connection.metadata.set(DidCommConnectionMetadataKeys.DidRotate, {\n threadId: message.threadId,\n did: resolvedDid.didDocument.id,\n mediatorId,\n })\n\n await agentContext.resolve(DidCommConnectionService).update(agentContext, connection)\n\n return message\n }\n\n public async createHangup(agentContext: AgentContext, options: { connection: DidCommConnectionRecord }) {\n const { connection } = options\n\n const message = new DidCommHangupMessage({})\n\n // Remove did to indicate termination status for this connection\n if (connection.did) {\n connection.previousDids = [...connection.previousDids, connection.did]\n }\n\n connection.did = undefined\n\n await agentContext.dependencyManager.resolve(DidCommConnectionService).update(agentContext, connection)\n\n return message\n }\n\n /**\n * Process a Hangup message and mark connection's theirDid as undefined so it is effectively terminated.\n * Connection Record itself is not deleted (TODO: config parameter to automatically do so)\n *\n * Its previous did will be stored in record in order to be able to recognize any message received\n * afterwards.\n *\n * @param messageContext\n */\n public async processHangup(messageContext: DidCommInboundMessageContext<DidCommHangupMessage>) {\n const connection = messageContext.assertReadyConnection()\n const { agentContext } = messageContext\n\n if (connection.theirDid) {\n connection.previousTheirDids = [...connection.previousTheirDids, connection.theirDid]\n }\n\n const previousTheirDid = connection.theirDid\n connection.theirDid = undefined\n\n await agentContext.dependencyManager.resolve(DidCommConnectionService).update(agentContext, connection)\n this.emitDidRotatedEvent(agentContext, connection, {\n previousTheirDid,\n })\n }\n\n /**\n * Process an incoming DID Rotate message and update connection if success. Any acknowledge\n * or problem report will be sent to the prior DID, so the created context will take former\n * connection record data\n *\n * @param paramInboundDidCommMessageContext\n * @param connection\n * @returns\n */\n public async processRotate(messageContext: DidCommInboundMessageContext<DidCommDidRotateMessage>) {\n const connection = messageContext.assertReadyConnection()\n const { message, agentContext } = messageContext\n\n // Check and store their new did\n const newDid = message.toDid\n\n // DID Rotation not supported for peer:1 dids, as we need explicit did document information\n if (isValidPeerDid(newDid) && getNumAlgoFromPeerDid(newDid) === PeerDidNumAlgo.GenesisDoc) {\n this.logger.error(`Unable to resolve DID Document for '${newDid}`)\n\n const response = new DidCommDidRotateProblemReportMessage({\n description: { en: 'DID Method Unsupported', code: 'e.did.method_unsupported' },\n })\n return new DidCommOutboundMessageContext(response, { agentContext, connection })\n }\n\n const didDocument = (await this.didResolverService.resolve(agentContext, newDid)).didDocument\n\n // Cannot resolve did\n if (!didDocument) {\n this.logger.error(`Unable to resolve DID Document for '${newDid}`)\n\n const response = new DidCommDidRotateProblemReportMessage({\n description: { en: 'DID Unresolvable', code: 'e.did.unresolvable' },\n })\n return new DidCommOutboundMessageContext(response, { agentContext, connection })\n }\n\n // Did is resolved but no compatible DIDComm services found\n if (!didDocument.didCommServices) {\n const response = new DidCommDidRotateProblemReportMessage({\n description: { en: 'DID Document Unsupported', code: 'e.did.doc_unsupported' },\n })\n return new DidCommOutboundMessageContext(response, { agentContext, connection })\n }\n\n // Send acknowledge to previous did and persist new did. Previous did will be stored in connection record in\n // order to still accept messages from it\n const outboundMessageContext = new DidCommOutboundMessageContext(\n new DidCommDidRotateAckMessage({\n threadId: message.threadId,\n status: AckStatus.OK,\n }),\n { agentContext, connection: connection.clone() }\n )\n\n // Store received did and update connection for further message processing\n await agentContext.dependencyManager.resolve(DidRepository).storeReceivedDid(agentContext, {\n did: didDocument.id,\n didDocument,\n tags: {\n // For did:peer, store any alternative dids (like short form did:peer:4),\n // it may have in order to relate any message referencing it\n alternativeDids: isValidPeerDid(didDocument.id) ? getAlternativeDidsForPeerDid(didDocument.id) : undefined,\n },\n })\n\n if (connection.theirDid) {\n connection.previousTheirDids = [...connection.previousTheirDids, connection.theirDid]\n }\n\n const previousTheirDid = connection.theirDid\n connection.theirDid = newDid\n\n await agentContext.dependencyManager.resolve(DidCommConnectionService).update(agentContext, connection)\n this.emitDidRotatedEvent(agentContext, connection, {\n previousTheirDid,\n })\n\n return outboundMessageContext\n }\n\n public async processRotateAck(inboundMessage: DidCommInboundMessageContext<DidCommDidRotateAckMessage>) {\n const { agentContext, message } = inboundMessage\n\n const connection = inboundMessage.assertReadyConnection()\n\n // Update connection info based on metadata set when creating the rotate message\n const didRotateMetadata = connection.metadata.get(DidCommConnectionMetadataKeys.DidRotate)\n\n if (!didRotateMetadata) {\n throw new CredoError(`No did rotation data found for connection with id '${connection.id}'`)\n }\n\n if (didRotateMetadata.threadId !== message.threadId) {\n throw new CredoError(\n `Existing did rotation flow thread id '${didRotateMetadata.threadId} does not match incoming message'`\n )\n }\n\n // Store previous did in order to still accept out-of-order messages that arrived later using it\n if (connection.did) connection.previousDids = [...connection.previousDids, connection.did]\n\n const previousOurDid = connection.did\n connection.did = didRotateMetadata.did\n connection.mediatorId = didRotateMetadata.mediatorId\n connection.metadata.delete(DidCommConnectionMetadataKeys.DidRotate)\n\n await agentContext.dependencyManager.resolve(DidCommConnectionService).update(agentContext, connection)\n this.emitDidRotatedEvent(agentContext, connection, {\n previousOurDid,\n })\n }\n\n /**\n * Process a problem report related to did rotate protocol, by simply deleting any temporary metadata.\n *\n * No specific event is thrown other than generic message processing\n *DidCommInboundMessageContext\n * @param messageContext\n */\n public async processProblemReport(\n messageContext: DidCommInboundMessageContext<DidCommDidRotateProblemReportMessage>\n ): Promise<void> {\n const { message, agentContext } = messageContext\n\n const connection = messageContext.assertReadyConnection()\n\n this.logger.debug(`Processing problem report with id ${message.id}`)\n\n // Delete any existing did rotation metadata in order to 'reset' the connection\n const didRotateMetadata = connection.metadata.get(DidCommConnectionMetadataKeys.DidRotate)\n\n if (!didRotateMetadata) {\n throw new CredoError(`No did rotation data found for connection with id '${connection.id}'`)\n }\n\n connection.metadata.delete(DidCommConnectionMetadataKeys.DidRotate)\n\n await agentContext.dependencyManager.resolve(DidCommConnectionService).update(agentContext, connection)\n }\n\n public async clearDidRotationData(agentContext: AgentContext, connection: DidCommConnectionRecord) {\n const didRotateMetadata = connection.metadata.get(DidCommConnectionMetadataKeys.DidRotate)\n\n if (!didRotateMetadata) {\n throw new CredoError(`No did rotation data found for connection with id '${connection.id}'`)\n }\n\n connection.metadata.delete(DidCommConnectionMetadataKeys.DidRotate)\n\n await agentContext.dependencyManager.resolve(DidCommConnectionService).update(agentContext, connection)\n }\n\n private emitDidRotatedEvent(\n agentContext: AgentContext,\n connectionRecord: DidCommConnectionRecord,\n { previousOurDid, previousTheirDid }: { previousOurDid?: string; previousTheirDid?: string }\n ) {\n this.eventEmitter.emit<DidCommConnectionDidRotatedEvent>(agentContext, {\n type: DidCommConnectionEventTypes.DidCommConnectionDidRotated,\n payload: {\n // Connection record in event should be static\n connectionRecord: connectionRecord.clone(),\n\n ourDid:\n previousOurDid && connectionRecord.did\n ? {\n from: previousOurDid,\n to: connectionRecord.did,\n }\n : undefined,\n\n theirDid:\n previousTheirDid && connectionRecord.theirDid\n ? {\n from: previousTheirDid,\n to: connectionRecord.theirDid,\n }\n : undefined,\n },\n })\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAoCO,oCAAMA,0BAAwB;CAKnC,AAAO,YACL,oBACA,AAAiCC,QACjC,cACA;AACA,OAAK,qBAAqB;AAC1B,OAAK,SAAS;AACd,OAAK,eAAe;;CAGtB,MAAa,aACX,cACA,SACA;EACA,MAAM,EAAE,YAAY,OAAO,YAAY;EAEvC,MAAM,SAAS,aAAa,QAAQ,+BAA+B;EACnE,MAAM,OAAO,aAAa,QAAQ,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