@aries-framework/anoncreds
Advanced tools
Comparing version 0.4.1-alpha.17 to 0.4.1-alpha.18
import type { V1CredentialProtocol } from '../V1CredentialProtocol'; | ||
import type { MessageHandler, MessageHandlerInboundMessage } from '@aries-framework/core'; | ||
import { OutboundMessageContext } from '@aries-framework/core'; | ||
import { V1IssueCredentialMessage } from '../messages'; | ||
@@ -9,4 +8,4 @@ export declare class V1IssueCredentialHandler implements MessageHandler { | ||
constructor(credentialProtocol: V1CredentialProtocol); | ||
handle(messageContext: MessageHandlerInboundMessage<V1IssueCredentialHandler>): Promise<OutboundMessageContext<import("../messages").V1CredentialAckMessage> | undefined>; | ||
handle(messageContext: MessageHandlerInboundMessage<V1IssueCredentialHandler>): Promise<import("@aries-framework/core").OutboundMessageContext<import("@aries-framework/core").AgentMessage> | undefined>; | ||
private acceptCredential; | ||
} |
@@ -26,26 +26,13 @@ "use strict"; | ||
}); | ||
const didCommMessageRepository = messageContext.agentContext.dependencyManager.resolve(core_1.DidCommMessageRepository); | ||
const requestMessage = await didCommMessageRepository.getAgentMessage(messageContext.agentContext, { | ||
associatedRecordId: credentialRecord.id, | ||
messageClass: messages_1.V1RequestCredentialMessage, | ||
const requestMessage = await this.credentialProtocol.findRequestMessage(messageContext.agentContext, credentialRecord.id); | ||
if (!requestMessage) { | ||
throw new core_1.AriesFrameworkError(`No request message found for credential record with id '${credentialRecord.id}'`); | ||
} | ||
return (0, core_1.getOutboundMessageContext)(messageContext.agentContext, { | ||
connectionRecord: messageContext.connection, | ||
message, | ||
associatedRecord: credentialRecord, | ||
lastReceivedMessage: messageContext.message, | ||
lastSentMessage: requestMessage, | ||
}); | ||
if (messageContext.connection) { | ||
return new core_1.OutboundMessageContext(message, { | ||
agentContext: messageContext.agentContext, | ||
connection: messageContext.connection, | ||
associatedRecord: credentialRecord, | ||
}); | ||
} | ||
else if (messageContext.message.service && requestMessage.service) { | ||
const recipientService = messageContext.message.service; | ||
const ourService = requestMessage.service; | ||
return new core_1.OutboundMessageContext(message, { | ||
agentContext: messageContext.agentContext, | ||
serviceParams: { | ||
service: recipientService.resolvedDidCommService, | ||
senderKey: ourService.resolvedDidCommService.recipientKeys[0], | ||
}, | ||
}); | ||
} | ||
messageContext.agentContext.config.logger.error(`Could not automatically create credential ack`); | ||
} | ||
@@ -52,0 +39,0 @@ } |
import type { V1CredentialProtocol } from '../V1CredentialProtocol'; | ||
import type { MessageHandler, MessageHandlerInboundMessage } from '@aries-framework/core'; | ||
import { OutboundMessageContext } from '@aries-framework/core'; | ||
import { V1OfferCredentialMessage } from '../messages'; | ||
@@ -9,4 +8,4 @@ export declare class V1OfferCredentialHandler implements MessageHandler { | ||
constructor(credentialProtocol: V1CredentialProtocol); | ||
handle(messageContext: MessageHandlerInboundMessage<V1OfferCredentialHandler>): Promise<OutboundMessageContext<import("../messages").V1RequestCredentialMessage> | undefined>; | ||
handle(messageContext: MessageHandlerInboundMessage<V1OfferCredentialHandler>): Promise<import("@aries-framework/core").OutboundMessageContext<import("@aries-framework/core").AgentMessage> | undefined>; | ||
private acceptOffer; | ||
} |
@@ -23,39 +23,9 @@ "use strict"; | ||
messageContext.agentContext.config.logger.info(`Automatically sending request with autoAccept`); | ||
if (messageContext.connection) { | ||
const { message } = await this.credentialProtocol.acceptOffer(messageContext.agentContext, { credentialRecord }); | ||
return new core_1.OutboundMessageContext(message, { | ||
agentContext: messageContext.agentContext, | ||
connection: messageContext.connection, | ||
associatedRecord: credentialRecord, | ||
}); | ||
} | ||
else if (messageContext.message.service) { | ||
const routingService = messageContext.agentContext.dependencyManager.resolve(core_1.RoutingService); | ||
const routing = await routingService.getRouting(messageContext.agentContext); | ||
const ourService = new core_1.ServiceDecorator({ | ||
serviceEndpoint: routing.endpoints[0], | ||
recipientKeys: [routing.recipientKey.publicKeyBase58], | ||
routingKeys: routing.routingKeys.map((key) => key.publicKeyBase58), | ||
}); | ||
const recipientService = messageContext.message.service; | ||
const { message } = await this.credentialProtocol.acceptOffer(messageContext.agentContext, { | ||
credentialRecord, | ||
}); | ||
// Set and save ~service decorator to record (to remember our verkey) | ||
message.service = ourService; | ||
const didCommMessageRepository = messageContext.agentContext.dependencyManager.resolve(core_1.DidCommMessageRepository); | ||
await didCommMessageRepository.saveOrUpdateAgentMessage(messageContext.agentContext, { | ||
agentMessage: message, | ||
role: core_1.DidCommMessageRole.Sender, | ||
associatedRecordId: credentialRecord.id, | ||
}); | ||
return new core_1.OutboundMessageContext(message, { | ||
agentContext: messageContext.agentContext, | ||
serviceParams: { | ||
service: recipientService.resolvedDidCommService, | ||
senderKey: ourService.resolvedDidCommService.recipientKeys[0], | ||
}, | ||
}); | ||
} | ||
messageContext.agentContext.config.logger.error(`Could not automatically create credential request`); | ||
const { message } = await this.credentialProtocol.acceptOffer(messageContext.agentContext, { credentialRecord }); | ||
return (0, core_1.getOutboundMessageContext)(messageContext.agentContext, { | ||
connectionRecord: messageContext.connection, | ||
message, | ||
associatedRecord: credentialRecord, | ||
lastReceivedMessage: messageContext.message, | ||
}); | ||
} | ||
@@ -62,0 +32,0 @@ } |
import type { V1CredentialProtocol } from '../V1CredentialProtocol'; | ||
import type { MessageHandler, MessageHandlerInboundMessage } from '@aries-framework/core'; | ||
import { OutboundMessageContext } from '@aries-framework/core'; | ||
import { V1ProposeCredentialMessage } from '../messages'; | ||
@@ -9,4 +8,4 @@ export declare class V1ProposeCredentialHandler implements MessageHandler { | ||
constructor(credentialProtocol: V1CredentialProtocol); | ||
handle(messageContext: MessageHandlerInboundMessage<V1ProposeCredentialHandler>): Promise<OutboundMessageContext<import("../messages").V1OfferCredentialMessage> | undefined>; | ||
handle(messageContext: MessageHandlerInboundMessage<V1ProposeCredentialHandler>): Promise<import("@aries-framework/core").OutboundMessageContext<import("@aries-framework/core").AgentMessage> | undefined>; | ||
private acceptProposal; | ||
} |
@@ -30,5 +30,5 @@ "use strict"; | ||
}); | ||
return new core_1.OutboundMessageContext(message, { | ||
agentContext: messageContext.agentContext, | ||
connection: messageContext.connection, | ||
return (0, core_1.getOutboundMessageContext)(messageContext.agentContext, { | ||
message, | ||
connectionRecord: messageContext.connection, | ||
associatedRecord: credentialRecord, | ||
@@ -35,0 +35,0 @@ }); |
import type { V1CredentialProtocol } from '../V1CredentialProtocol'; | ||
import type { MessageHandler, MessageHandlerInboundMessage } from '@aries-framework/core'; | ||
import { OutboundMessageContext } from '@aries-framework/core'; | ||
import { V1RequestCredentialMessage } from '../messages'; | ||
@@ -9,4 +8,4 @@ export declare class V1RequestCredentialHandler implements MessageHandler { | ||
constructor(credentialProtocol: V1CredentialProtocol); | ||
handle(messageContext: MessageHandlerInboundMessage<V1RequestCredentialHandler>): Promise<OutboundMessageContext<import("../messages").V1IssueCredentialMessage> | undefined>; | ||
handle(messageContext: MessageHandlerInboundMessage<V1RequestCredentialHandler>): Promise<import("@aries-framework/core").OutboundMessageContext<import("@aries-framework/core").AgentMessage> | undefined>; | ||
private acceptRequest; | ||
} |
@@ -24,32 +24,15 @@ "use strict"; | ||
const offerMessage = await this.credentialProtocol.findOfferMessage(messageContext.agentContext, credentialRecord.id); | ||
if (!offerMessage) { | ||
throw new core_1.AriesFrameworkError(`Could not find offer message for credential record with id ${credentialRecord.id}`); | ||
} | ||
const { message } = await this.credentialProtocol.acceptRequest(messageContext.agentContext, { | ||
credentialRecord, | ||
}); | ||
if (messageContext.connection) { | ||
return new core_1.OutboundMessageContext(message, { | ||
agentContext: messageContext.agentContext, | ||
connection: messageContext.connection, | ||
associatedRecord: credentialRecord, | ||
}); | ||
} | ||
else if (messageContext.message.service && (offerMessage === null || offerMessage === void 0 ? void 0 : offerMessage.service)) { | ||
const recipientService = messageContext.message.service; | ||
const ourService = offerMessage.service; | ||
// Set ~service, update message in record (for later use) | ||
message.setService(ourService); | ||
const didCommMessageRepository = messageContext.agentContext.dependencyManager.resolve(core_1.DidCommMessageRepository); | ||
await didCommMessageRepository.saveOrUpdateAgentMessage(messageContext.agentContext, { | ||
agentMessage: message, | ||
role: core_1.DidCommMessageRole.Sender, | ||
associatedRecordId: credentialRecord.id, | ||
}); | ||
return new core_1.OutboundMessageContext(message, { | ||
agentContext: messageContext.agentContext, | ||
serviceParams: { | ||
service: recipientService.resolvedDidCommService, | ||
senderKey: ourService.resolvedDidCommService.recipientKeys[0], | ||
}, | ||
}); | ||
} | ||
messageContext.agentContext.config.logger.error(`Could not automatically create credential request`); | ||
return (0, core_1.getOutboundMessageContext)(messageContext.agentContext, { | ||
connectionRecord: messageContext.connection, | ||
message, | ||
associatedRecord: credentialRecord, | ||
lastReceivedMessage: messageContext.message, | ||
lastSentMessage: offerMessage, | ||
}); | ||
} | ||
@@ -56,0 +39,0 @@ } |
@@ -114,13 +114,13 @@ "use strict"; | ||
credentialRecord.assertState(core_1.CredentialState.OfferSent); | ||
const previousReceivedMessage = await didCommMessageRepository.findAgentMessage(messageContext.agentContext, { | ||
const lastReceivedMessage = await didCommMessageRepository.findAgentMessage(messageContext.agentContext, { | ||
associatedRecordId: credentialRecord.id, | ||
messageClass: messages_1.V1ProposeCredentialMessage, | ||
}); | ||
const previousSentMessage = await didCommMessageRepository.getAgentMessage(messageContext.agentContext, { | ||
const lastSentMessage = await didCommMessageRepository.getAgentMessage(messageContext.agentContext, { | ||
associatedRecordId: credentialRecord.id, | ||
messageClass: messages_1.V1OfferCredentialMessage, | ||
}); | ||
connectionService.assertConnectionOrServiceDecorator(messageContext, { | ||
previousReceivedMessage, | ||
previousSentMessage, | ||
await connectionService.assertConnectionOrOutOfBandExchange(messageContext, { | ||
lastReceivedMessage, | ||
lastSentMessage, | ||
}); | ||
@@ -153,3 +153,3 @@ await this.indyCredentialFormat.processProposal(messageContext.agentContext, { | ||
// Assert | ||
connectionService.assertConnectionOrServiceDecorator(messageContext); | ||
await connectionService.assertConnectionOrOutOfBandExchange(messageContext); | ||
// Save record | ||
@@ -338,7 +338,7 @@ await credentialRepository.save(messageContext.agentContext, credentialRecord); | ||
if (credentialRecord) { | ||
const previousSentMessage = await didCommMessageRepository.getAgentMessage(messageContext.agentContext, { | ||
const lastSentMessage = await didCommMessageRepository.getAgentMessage(messageContext.agentContext, { | ||
associatedRecordId: credentialRecord.id, | ||
messageClass: messages_1.V1ProposeCredentialMessage, | ||
}); | ||
const previousReceivedMessage = await didCommMessageRepository.findAgentMessage(messageContext.agentContext, { | ||
const lastReceivedMessage = await didCommMessageRepository.findAgentMessage(messageContext.agentContext, { | ||
associatedRecordId: credentialRecord.id, | ||
@@ -350,5 +350,5 @@ messageClass: messages_1.V1OfferCredentialMessage, | ||
credentialRecord.assertState(core_1.CredentialState.ProposalSent); | ||
connectionService.assertConnectionOrServiceDecorator(messageContext, { | ||
previousReceivedMessage, | ||
previousSentMessage, | ||
await connectionService.assertConnectionOrOutOfBandExchange(messageContext, { | ||
lastReceivedMessage, | ||
lastSentMessage, | ||
}); | ||
@@ -376,3 +376,3 @@ await this.indyCredentialFormat.processOffer(messageContext.agentContext, { | ||
// Assert | ||
connectionService.assertConnectionOrServiceDecorator(messageContext); | ||
await connectionService.assertConnectionOrOutOfBandExchange(messageContext); | ||
await this.indyCredentialFormat.processOffer(messageContext.agentContext, { | ||
@@ -516,5 +516,5 @@ credentialRecord, | ||
credentialRecord.assertState(core_1.CredentialState.OfferSent); | ||
connectionService.assertConnectionOrServiceDecorator(messageContext, { | ||
previousReceivedMessage: proposalMessage !== null && proposalMessage !== void 0 ? proposalMessage : undefined, | ||
previousSentMessage: offerMessage !== null && offerMessage !== void 0 ? offerMessage : undefined, | ||
await connectionService.assertConnectionOrOutOfBandExchange(messageContext, { | ||
lastReceivedMessage: proposalMessage !== null && proposalMessage !== void 0 ? proposalMessage : undefined, | ||
lastSentMessage: offerMessage !== null && offerMessage !== void 0 ? offerMessage : undefined, | ||
}); | ||
@@ -612,5 +612,5 @@ const requestAttachment = requestMessage.getRequestAttachmentById(messages_1.INDY_CREDENTIAL_REQUEST_ATTACHMENT_ID); | ||
credentialRecord.assertState(core_1.CredentialState.RequestSent); | ||
connectionService.assertConnectionOrServiceDecorator(messageContext, { | ||
previousReceivedMessage: offerCredentialMessage, | ||
previousSentMessage: requestCredentialMessage, | ||
await connectionService.assertConnectionOrOutOfBandExchange(messageContext, { | ||
lastReceivedMessage: offerCredentialMessage, | ||
lastSentMessage: requestCredentialMessage, | ||
}); | ||
@@ -682,5 +682,5 @@ const issueAttachment = issueMessage.getCredentialAttachmentById(messages_1.INDY_CREDENTIAL_ATTACHMENT_ID); | ||
credentialRecord.assertState(core_1.CredentialState.CredentialIssued); | ||
connectionService.assertConnectionOrServiceDecorator(messageContext, { | ||
previousReceivedMessage: requestCredentialMessage, | ||
previousSentMessage: issueCredentialMessage, | ||
await connectionService.assertConnectionOrOutOfBandExchange(messageContext, { | ||
lastReceivedMessage: requestCredentialMessage, | ||
lastSentMessage: issueCredentialMessage, | ||
}); | ||
@@ -687,0 +687,0 @@ // Update record |
import type { V1ProofProtocol } from '../V1ProofProtocol'; | ||
import type { MessageHandler, MessageHandlerInboundMessage } from '@aries-framework/core'; | ||
import { OutboundMessageContext } from '@aries-framework/core'; | ||
import { V1PresentationMessage } from '../messages'; | ||
@@ -9,4 +8,4 @@ export declare class V1PresentationHandler implements MessageHandler { | ||
constructor(proofProtocol: V1ProofProtocol); | ||
handle(messageContext: MessageHandlerInboundMessage<V1PresentationHandler>): Promise<OutboundMessageContext<import("../messages").V1PresentationAckMessage> | undefined>; | ||
handle(messageContext: MessageHandlerInboundMessage<V1PresentationHandler>): Promise<import("@aries-framework/core").OutboundMessageContext<import("@aries-framework/core").AgentMessage> | undefined>; | ||
private acceptPresentation; | ||
} |
@@ -23,37 +23,16 @@ "use strict"; | ||
messageContext.agentContext.config.logger.info(`Automatically sending acknowledgement with autoAccept`); | ||
if (messageContext.connection) { | ||
const { message } = await this.proofProtocol.acceptPresentation(messageContext.agentContext, { | ||
proofRecord, | ||
}); | ||
return new core_1.OutboundMessageContext(message, { | ||
agentContext: messageContext.agentContext, | ||
connection: messageContext.connection, | ||
associatedRecord: proofRecord, | ||
}); | ||
const requestMessage = await this.proofProtocol.findRequestMessage(messageContext.agentContext, proofRecord.id); | ||
if (!requestMessage) { | ||
throw new core_1.AriesFrameworkError(`No request message found for proof record with id '${proofRecord.id}'`); | ||
} | ||
else if (messageContext.message.service) { | ||
const { message } = await this.proofProtocol.acceptPresentation(messageContext.agentContext, { | ||
proofRecord, | ||
}); | ||
const didCommMessageRepository = messageContext.agentContext.dependencyManager.resolve(core_1.DidCommMessageRepository); | ||
const requestMessage = await didCommMessageRepository.findAgentMessage(messageContext.agentContext, { | ||
associatedRecordId: proofRecord.id, | ||
messageClass: messages_1.V1RequestPresentationMessage, | ||
}); | ||
const recipientService = messageContext.message.service; | ||
const ourService = requestMessage === null || requestMessage === void 0 ? void 0 : requestMessage.service; | ||
if (!ourService) { | ||
messageContext.agentContext.config.logger.error(`Could not automatically create presentation ack. Missing ourService on request message`); | ||
return; | ||
} | ||
return new core_1.OutboundMessageContext(message, { | ||
agentContext: messageContext.agentContext, | ||
serviceParams: { | ||
service: recipientService.resolvedDidCommService, | ||
senderKey: ourService.resolvedDidCommService.recipientKeys[0], | ||
returnRoute: true, | ||
}, | ||
}); | ||
} | ||
messageContext.agentContext.config.logger.error(`Could not automatically create presentation ack`); | ||
const { message } = await this.proofProtocol.acceptPresentation(messageContext.agentContext, { | ||
proofRecord, | ||
}); | ||
return (0, core_1.getOutboundMessageContext)(messageContext.agentContext, { | ||
message, | ||
lastReceivedMessage: messageContext.message, | ||
lastSentMessage: requestMessage, | ||
associatedRecord: proofRecord, | ||
connectionRecord: messageContext.connection, | ||
}); | ||
} | ||
@@ -60,0 +39,0 @@ } |
import type { V1ProofProtocol } from '../V1ProofProtocol'; | ||
import type { MessageHandler, MessageHandlerInboundMessage } from '@aries-framework/core'; | ||
import { OutboundMessageContext } from '@aries-framework/core'; | ||
import { V1RequestPresentationMessage } from '../messages'; | ||
@@ -9,4 +8,4 @@ export declare class V1RequestPresentationHandler implements MessageHandler { | ||
constructor(proofProtocol: V1ProofProtocol); | ||
handle(messageContext: MessageHandlerInboundMessage<V1RequestPresentationHandler>): Promise<OutboundMessageContext<import("@aries-framework/core").AgentMessage> | undefined>; | ||
handle(messageContext: MessageHandlerInboundMessage<V1RequestPresentationHandler>): Promise<import("@aries-framework/core").OutboundMessageContext<import("@aries-framework/core").AgentMessage> | undefined>; | ||
private acceptRequest; | ||
} |
@@ -23,42 +23,11 @@ "use strict"; | ||
messageContext.agentContext.config.logger.info(`Automatically sending presentation with autoAccept on`); | ||
if (messageContext.connection) { | ||
const { message } = await this.proofProtocol.acceptRequest(messageContext.agentContext, { | ||
proofRecord, | ||
}); | ||
return new core_1.OutboundMessageContext(message, { | ||
agentContext: messageContext.agentContext, | ||
connection: messageContext.connection, | ||
associatedRecord: proofRecord, | ||
}); | ||
} | ||
else if (messageContext.message.service) { | ||
const { message } = await this.proofProtocol.acceptRequest(messageContext.agentContext, { | ||
proofRecord, | ||
}); | ||
const routingService = messageContext.agentContext.dependencyManager.resolve(core_1.RoutingService); | ||
const routing = await routingService.getRouting(messageContext.agentContext); | ||
const ourService = new core_1.ServiceDecorator({ | ||
serviceEndpoint: routing.endpoints[0], | ||
recipientKeys: [routing.recipientKey.publicKeyBase58], | ||
routingKeys: routing.routingKeys.map((key) => key.publicKeyBase58), | ||
}); | ||
const recipientService = messageContext.message.service; | ||
// Set and save ~service decorator to record (to remember our verkey) | ||
message.service = ourService; | ||
const didCommMessageRepository = messageContext.agentContext.dependencyManager.resolve(core_1.DidCommMessageRepository); | ||
await didCommMessageRepository.saveOrUpdateAgentMessage(messageContext.agentContext, { | ||
agentMessage: message, | ||
associatedRecordId: proofRecord.id, | ||
role: core_1.DidCommMessageRole.Sender, | ||
}); | ||
return new core_1.OutboundMessageContext(message, { | ||
agentContext: messageContext.agentContext, | ||
serviceParams: { | ||
service: recipientService.resolvedDidCommService, | ||
senderKey: message.service.resolvedDidCommService.recipientKeys[0], | ||
returnRoute: true, | ||
}, | ||
}); | ||
} | ||
messageContext.agentContext.config.logger.error(`Could not automatically create presentation`); | ||
const { message } = await this.proofProtocol.acceptRequest(messageContext.agentContext, { | ||
proofRecord, | ||
}); | ||
return (0, core_1.getOutboundMessageContext)(messageContext.agentContext, { | ||
message, | ||
lastReceivedMessage: messageContext.message, | ||
associatedRecord: proofRecord, | ||
connectionRecord: messageContext.connection, | ||
}); | ||
} | ||
@@ -65,0 +34,0 @@ } |
@@ -96,13 +96,13 @@ "use strict"; | ||
proofRecord.assertProtocolVersion('v1'); | ||
const previousReceivedMessage = await didCommMessageRepository.findAgentMessage(agentContext, { | ||
const lastReceivedMessage = await didCommMessageRepository.findAgentMessage(agentContext, { | ||
associatedRecordId: proofRecord.id, | ||
messageClass: messages_1.V1ProposePresentationMessage, | ||
}); | ||
const previousSentMessage = await didCommMessageRepository.getAgentMessage(agentContext, { | ||
const lastSentMessage = await didCommMessageRepository.getAgentMessage(agentContext, { | ||
associatedRecordId: proofRecord.id, | ||
messageClass: messages_1.V1RequestPresentationMessage, | ||
}); | ||
connectionService.assertConnectionOrServiceDecorator(messageContext, { | ||
previousReceivedMessage, | ||
previousSentMessage, | ||
await connectionService.assertConnectionOrOutOfBandExchange(messageContext, { | ||
lastReceivedMessage, | ||
lastSentMessage, | ||
}); | ||
@@ -128,3 +128,3 @@ // Update record | ||
// Assert | ||
connectionService.assertConnectionOrServiceDecorator(messageContext); | ||
await connectionService.assertConnectionOrOutOfBandExchange(messageContext); | ||
await didCommMessageRepository.saveOrUpdateAgentMessage(agentContext, { | ||
@@ -277,7 +277,7 @@ agentMessage: proposalMessage, | ||
if (proofRecord) { | ||
const previousReceivedMessage = await didCommMessageRepository.findAgentMessage(agentContext, { | ||
const lastReceivedMessage = await didCommMessageRepository.findAgentMessage(agentContext, { | ||
associatedRecordId: proofRecord.id, | ||
messageClass: messages_1.V1RequestPresentationMessage, | ||
}); | ||
const previousSentMessage = await didCommMessageRepository.getAgentMessage(agentContext, { | ||
const lastSentMessage = await didCommMessageRepository.getAgentMessage(agentContext, { | ||
associatedRecordId: proofRecord.id, | ||
@@ -289,5 +289,5 @@ messageClass: messages_1.V1ProposePresentationMessage, | ||
proofRecord.assertState(core_1.ProofState.ProposalSent); | ||
connectionService.assertConnectionOrServiceDecorator(messageContext, { | ||
previousReceivedMessage, | ||
previousSentMessage, | ||
await connectionService.assertConnectionOrOutOfBandExchange(messageContext, { | ||
lastReceivedMessage, | ||
lastSentMessage, | ||
}); | ||
@@ -324,3 +324,3 @@ await this.indyProofFormat.processRequest(agentContext, { | ||
// Assert | ||
connectionService.assertConnectionOrServiceDecorator(messageContext); | ||
await connectionService.assertConnectionOrOutOfBandExchange(messageContext); | ||
// Save in repository | ||
@@ -525,5 +525,5 @@ await proofRepository.save(agentContext, proofRecord); | ||
proofRecord.assertProtocolVersion('v1'); | ||
connectionService.assertConnectionOrServiceDecorator(messageContext, { | ||
previousReceivedMessage: proposalMessage, | ||
previousSentMessage: requestMessage, | ||
await connectionService.assertConnectionOrOutOfBandExchange(messageContext, { | ||
lastReceivedMessage: proposalMessage, | ||
lastSentMessage: requestMessage, | ||
}); | ||
@@ -575,7 +575,7 @@ const presentationAttachment = presentationMessage.getPresentationAttachmentById(messages_1.INDY_PROOF_ATTACHMENT_ID); | ||
const proofRecord = await this.getByThreadAndConnectionId(agentContext, presentationAckMessage.threadId, connection === null || connection === void 0 ? void 0 : connection.id); | ||
const previousReceivedMessage = await didCommMessageRepository.getAgentMessage(agentContext, { | ||
const lastReceivedMessage = await didCommMessageRepository.getAgentMessage(agentContext, { | ||
associatedRecordId: proofRecord.id, | ||
messageClass: messages_1.V1RequestPresentationMessage, | ||
}); | ||
const previousSentMessage = await didCommMessageRepository.getAgentMessage(agentContext, { | ||
const lastSentMessage = await didCommMessageRepository.getAgentMessage(agentContext, { | ||
associatedRecordId: proofRecord.id, | ||
@@ -587,5 +587,5 @@ messageClass: messages_1.V1PresentationMessage, | ||
proofRecord.assertState(core_1.ProofState.PresentationSent); | ||
connectionService.assertConnectionOrServiceDecorator(messageContext, { | ||
previousReceivedMessage, | ||
previousSentMessage, | ||
await connectionService.assertConnectionOrOutOfBandExchange(messageContext, { | ||
lastReceivedMessage, | ||
lastSentMessage, | ||
}); | ||
@@ -592,0 +592,0 @@ // Update record |
@@ -5,3 +5,3 @@ { | ||
"types": "build/index", | ||
"version": "0.4.1-alpha.17+c6f03e49", | ||
"version": "0.4.1-alpha.18+9e69cf44", | ||
"files": [ | ||
@@ -28,3 +28,3 @@ "build" | ||
"dependencies": { | ||
"@aries-framework/core": "0.4.1-alpha.17+c6f03e49", | ||
"@aries-framework/core": "0.4.1-alpha.18+9e69cf44", | ||
"bn.js": "^5.2.1", | ||
@@ -36,3 +36,3 @@ "class-transformer": "0.5.1", | ||
"devDependencies": { | ||
"@aries-framework/node": "0.4.1-alpha.17+c6f03e49", | ||
"@aries-framework/node": "0.4.1-alpha.18+9e69cf44", | ||
"indy-sdk": "^1.16.0-dev-1636", | ||
@@ -43,3 +43,3 @@ "rimraf": "^4.4.0", | ||
}, | ||
"gitHead": "c6f03e49d79a33b1c4b459cef11add93dee051d0" | ||
"gitHead": "9e69cf441a75bf7a3c5556cf59e730ee3fce8c28" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
775392
10114